์ „์ฒด ๊ธ€ 202

35. ํŒ€, ์—์ด์ „ํŠธ ์ „์ฒด ์กฐํšŒ

35. ํŒ€, ์—์ด์ „ํŠธ ์ „์ฒด ์กฐํšŒ ํŒ€ ์ €์žฅ์†Œ์— ์ „์ฒด ์กฐํšŒ jpa๋ฌธ ์ž‘์„ฑ package com.example.repository; import java.util.List; import com.example.entity.Team; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface TeamRepository extends JpaRepository{ //ํŒ€ ์ „์ฒด ์กฐํšŒ List findAllByOrderByTeamnoDesc(); } ํŒ€ ์„œ๋น„์Šค์— ์ „์ฒด ์กฐํšŒ ์ถ”๊ฐ€ 1. TeamService //ํŒ€ ์ „์ฒด ์กฐํšŒ publi..

34. role ์— ๋”ฐ๋ฅธ ๋ฉ”๋‰ด๋ฐ” ์ˆ˜์ •

34. role ์— ๋”ฐ๋ฅธ ๋ฉ”๋‰ด๋ฐ” ์ˆ˜์ • ํ˜„์žฌ ๋กœ๊ทธ์ธ ์œ ๋ฌด ๋˜๋Š” ๋กœ๊ทธ์ธ์„ user๋‚˜ admin์œผ๋กœ ํ•ด๋„ ๊ฐ™์€ ๋ฉ”๋‰ด๋ฐ”๊ฐ€ ๋…ธ์ถœ๋˜๊ณ  ์žˆ๋‹ค. ๊ทธ๋ž˜์„œ ๊ถŒํ•œ(role)๊ณผ ๋กœ๊ทธ์ธ ์œ ๋ฌด์— ๋”ฐ๋ผ ๋…ธ์ถœ๋˜๋Š” ๋ฉ”๋‰ด๋ฐ”๋ฅผ ์ˆ˜์ •ํ•œ๋‹ค. ๋กœ๊ทธ์ธ ์„ฑ๊ณต ์‹œ role ์ •๋ณด ์ „๋‹ฌ(๋ฐฑ์—”๋“œ) 1. MemberController - ๋กœ๊ทธ์ธ ์ˆ˜์ • //๋กœ๊ทธ์ธ //127.0.0.1:8080/REST/member/login @RequestMapping(value = "/member/login", method = {RequestMethod.POST}, consumes = MediaType.ALL_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public Map loginPOST(@RequestBody Member..

33. ํŒ€, ์—์ด์ „ํŠธ ๋“ฑ๋ก

33. ํŒ€, ์—์ด์ „ํŠธ ๋“ฑ๋ก 9. ํŒ€, ์—์ด์ „ํŠธ ๋“ฑ๋ก ์—ฐ๋™ ๋“ฑ๋ก ํŽ˜์ด์ง€ ๋ผ์šฐํ„ฐ ์ถ”๊ฐ€ 1. ๋“ฑ๋ก ํŒŒ์ผ ์ƒ์„ฑ 2. ๋ผ์šฐํ„ฐ ์ถ”๊ฐ€ 2-1. index.js import { createWebHistory, createRouter } from "vue-router"; import Home from '@/components/Home' import Join from '@/components/Join' import Login from '@/components/Login' import Logout from '@/components/Logout' import Registration from '@/components/Registration' const routes = [ {path:'/', name:'Home', compone..

32. ๋กœ๊ทธ์•„์›ƒ

32. ๋กœ๊ทธ์•„์›ƒ sessionStorage์— ์ €์žฅ๋œ ํ† ํฐ์„ ์ œ๊ฑฐํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๋กœ๊ทธ์•„์›ƒ์„ ๊ตฌํ˜„ํ•œ๋‹ค. ๋กœ๊ทธ์•„์›ƒ ํŽ˜์ด์ง€ ๋ผ์šฐํ„ฐ ์ถ”๊ฐ€ 1. ๋กœ๊ทธ์•„์›ƒ ํŒŒ์ผ ์ƒ์„ฑ 2. ๋ผ์šฐํ„ฐ ์ถ”๊ฐ€ 2-1. index.js import { createWebHistory, createRouter } from "vue-router"; import Home from '@/components/Home' import Join from '@/components/Join' import Login from '@/components/Login' import Logout from '@/components/Logout' const routes = [ {path:'/', name:'Home', component:Home}, {path:'/Join', na..

31. ๋กœ๊ทธ์ธ

31. ๋กœ๊ทธ์ธ 7. ๋กœ๊ทธ์ธ ์—ฐ๋™ ๋กœ๊ทธ์ธ ํŽ˜์ด์ง€ ๋ผ์šฐํ„ฐ ์ถ”๊ฐ€ 1. ๋กœ๊ทธ์ธ ํŒŒ์ผ ์ƒ์„ฑ 2. ๋ผ์šฐํ„ฐ ์ถ”๊ฐ€ 2-1. index.js import { createWebHistory, createRouter } from "vue-router"; import Home from '@/components/Home' import Join from '@/components/Join' import Login from '@/components/Login' const routes = [ {path:'/', name:'Home', component:Home}, {path:'/Join', name:'Join', component:Join}, {path:'/Login', name:'Login', component:Login}, ] c..

30. ์•„์ด๋”” ์ค‘๋ณต ํ™•์ธ

30. ์•„์ด๋”” ์ค‘๋ณต ํ™•์ธ ๊ฐ™์€ ์•„์ด๋””๊ฐ€ ๊ฐ€์ž… ๋˜๋Š” ๊ฒƒ์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ์ค‘๋ณต ํ™•์ธ์„ ์ถ”๊ฐ€ํ•œ๋‹ค. ๋ฐฑ์—”๋“œ(spring) member ์ €์žฅ์†Œ์— ์ค‘๋ณต ํ™•์ธ ์ฟผ๋ฆฌ๋ฌธ ์ž‘์„ฑ // userid ์ค‘๋ณต ์กฐํšŒ @Query(value = "SELECT COUNT(USERID) FROM USER WHERE USERID =:userid", nativeQuery = true) public int queryCheckUserid(String userid); member ์„œ๋น„์Šค์— ์ค‘๋ณต ํ™•์ธ ์ƒ์„ฑ 1. MemberService // userid ์ค‘๋ณต ํ™•์ธ public int checkUserid(String id); 2. MemberServiceImpl // userid ์ค‘๋ณต ํ™•์ธ @Override public int checkUserid..

29. ํšŒ์› ๊ฐ€์ž…

29. ํšŒ์› ๊ฐ€์ž… 6. ํšŒ์›๊ฐ€์ž… ์—ฐ๋™ axios ์„ค์น˜ npm install axios --save ํšŒ์› ๊ฐ€์ž… ํŽ˜์ด์ง€ ๋ผ์šฐํ„ฐ ์ถ”๊ฐ€ 1. join ํŒŒ์ผ ์ƒ์„ฑ 2. ๋ผ์šฐํ„ฐ ์ถ”๊ฐ€ 2-1. index.js import { createWebHistory, createRouter } from "vue-router"; import Home from '@/components/Home' import Join from '@/components/Join' const routes = [ {path:'/', name:'Home', component:Home}, {path:'/Join', name:'Join', component:Join}, ] const router = createRouter({ history: createWeb..

28. vue ์ƒ์„ฑ(spring ์—ฐ๋™)

28. vue ์ƒ์„ฑ(spring ์—ฐ๋™) vue ํด๋” ์ƒ์„ฑ 1. vue ํด๋”๋ฅผ ์ƒ์„ฑํ•  ์œ„์น˜์—์„œ cmd ์ฐฝ ์‹คํ–‰ 2. ํด๋” ์ƒ์„ฑ ์„ค์ • 1. ์ƒ์„ฑํ•œ vue ์‹คํ–‰ 2. vue.config.js ์ƒ์„ฑ, spring ์—ฐ๋™ module.exports= { //๊ฐœ๋ฐœ ์„œ๋ฒ„ ์„ค์ • devServer: { //ํ”„๋ก์‹œ ์„ค์ • proxy: { //127.0.0.1:8080/REST '/REST':{ //ํ”„๋ก์‹œ ์š”์ฒญ์„ ๋ณด๋‚ธ ์„œ๋ฒ„์˜ ์ฃผ์†Œ target: 'http://localhost:8080', changeOrigin: true, logLevel: 'debug', } }, //vue์˜ ํฌํŠธ ๋ฒˆํ˜ธ //127.0.0.1:9090 port: 9090 } }; ๋ผ์šฐํ„ฐ ์„ค์น˜ * ๋ผ์šฐํ„ฐ : ๋ผ์šฐํŒ…(์›น ํŽ˜์ด์ง€ ๊ฐ„ ์ด๋™๋ฐฉ๋ฒ•) ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ๊ฒŒ..

27. ์„ ์ˆ˜ ์กฐํšŒ(ํฌ์ง€์…˜)

27. ์„ ์ˆ˜ ์กฐํšŒ(ํฌ์ง€์…˜) ์„ ์ˆ˜ ์ €์žฅ์†Œ์— ์ฟผ๋ฆฌ๋ฌธ ์ž‘์„ฑ //ํฌ์ง€์…˜ ๋ณ„ ์„ ์ˆ˜ ์กฐํšŒ @Query(value = "SELECT * FROM PLAYER WHERE PLAYERPOSITION = :position", nativeQuery = true) public List queryListPlayerPosition(@Param("position") String position, Pageable pageable); ์„ ์ˆ˜ ์„œ๋น„์Šค์— ์„ ์ˆ˜ ์กฐํšŒ ์ƒ์„ฑ 1. PlayerService //ํฌ์ง€์…˜ ๋ณ„ ์„ ์ˆ˜ ์กฐํšŒ public List getPlayerALLposition(String position, Pageable pageable); 2. PlayerServiceImpl //ํฌ์ง€์…˜ ๋ณ„ ์„ ์ˆ˜ ์กฐํšŒ @Override public ..

26. ์„ ์ˆ˜ ์กฐํšŒ(๋ชธ๊ฐ’)

26. ์„ ์ˆ˜ ์กฐํšŒ(๋ชธ๊ฐ’) ์„ ์ˆ˜ ์ €์žฅ์†Œ์— ์ฟผ๋ฆฌ๋ฌธ ์ž‘์„ฑ //๋ชธ๊ฐ’ ๋ณ„ ์„ ์ˆ˜ ์กฐํšŒ(๋‚ด๋ฆผ์ฐจ์ˆœ) @Query(value = "SELECT * FROM PLAYER ORDER BY PLAYERPRICE DESC", nativeQuery = true) public List queryListPlayerDESC(Pageable pageable); //๋ชธ๊ฐ’ ๋ณ„ ์„ ์ˆ˜ ์กฐํšŒ(์˜ค๋ฆ„์ฐจ์ˆœ) @Query(value = "SELECT * FROM PLAYER ORDER BY PLAYERPRICE", nativeQuery = true) public List queryListPlayerASC(Pageable pageable); ์„ ์ˆ˜ ์„œ๋น„์Šค์— ์„ ์ˆ˜ ์กฐํšŒ ์ƒ์„ฑ 1. PlayerService //๋ชธ๊ฐ’ ๋ณ„ ์„ ์ˆ˜ ์กฐํšŒ(๋‚ด๋ฆผ์ฐจ์ˆœ) public Lis..