From 6c3426c02d55af6032ac529f0b04252c4560d21a Mon Sep 17 00:00:00 2001 From: kyeong-hyeok Date: Thu, 30 Nov 2023 12:32:12 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EC=84=9C=EB=B8=8C=20=EB=8F=84?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=EC=84=A4=EC=A0=95=20=ED=9B=84=20uri=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20(#60)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/project/mapdagu/MapdaguApplication.java | 2 +- .../com/project/mapdagu/config/SecurityConfig.java | 8 ++++---- .../domain/auth/controller/AuthController.java | 2 +- .../domain/auth/controller/SignUpController.java | 2 +- .../filter/CustomJsonAuthenticationFilter.java | 2 +- .../controller/EvaluationController.java | 2 +- .../domain/food/controller/FoodController.java | 2 +- .../domain/friend/controller/FriendController.java | 2 +- .../controller/FriendRequestController.java | 2 +- .../domain/member/controller/MemberController.java | 2 +- .../domain/test/controller/TestController.java | 2 +- .../filter/JwtAuthenticationProcessingFilter.java | 2 +- .../domain/auth/controller/AuthControllerTest.java | 2 +- .../auth/controller/SignUpControllerTest.java | 4 ++-- .../controller/EvaluationControllerTest.java | 14 +++++++------- .../domain/food/controller/FoodControllerTest.java | 6 +++--- .../friend/controller/FriendControllerTest.java | 8 ++++---- .../controller/FriendRequestControllerTest.java | 6 +++--- .../member/controller/MemberControllerTest.java | 8 ++++---- .../domain/test/controller/TestControllerTest.java | 6 +++--- 20 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/project/mapdagu/MapdaguApplication.java b/src/main/java/com/project/mapdagu/MapdaguApplication.java index 884dee0..579558f 100644 --- a/src/main/java/com/project/mapdagu/MapdaguApplication.java +++ b/src/main/java/com/project/mapdagu/MapdaguApplication.java @@ -7,7 +7,7 @@ import org.springframework.cache.annotation.EnableCaching; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; -@OpenAPIDefinition(servers = {@Server(url = "/", description = "https://mapdagu.site")}) +@OpenAPIDefinition(servers = {@Server(url = "/", description = "https://dev-api.mapdagu.site")}) @EnableJpaAuditing @EnableCaching @SpringBootApplication diff --git a/src/main/java/com/project/mapdagu/config/SecurityConfig.java b/src/main/java/com/project/mapdagu/config/SecurityConfig.java index 561b177..5798f9f 100644 --- a/src/main/java/com/project/mapdagu/config/SecurityConfig.java +++ b/src/main/java/com/project/mapdagu/config/SecurityConfig.java @@ -61,8 +61,8 @@ public SecurityFilterChain filterChain(HttpSecurity http, HandlerMappingIntrospe .headers(headers -> headers.frameOptions(frameOptions -> frameOptions.disable())) .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .authorizeHttpRequests(request -> - request.requestMatchers(mvcMatcherBuilder.pattern("/login")).permitAll() - .requestMatchers(mvcMatcherBuilder.pattern("/api/sign-up")).permitAll() + request.requestMatchers(mvcMatcherBuilder.pattern("/auth/login")).permitAll() + .requestMatchers(mvcMatcherBuilder.pattern("/sign-up")).permitAll() .requestMatchers(mvcMatcherBuilder.pattern("/h2-console/**")).permitAll() .requestMatchers(mvcMatcherBuilder.pattern("/css/**")).permitAll() .requestMatchers(mvcMatcherBuilder.pattern("/js/**")).permitAll() @@ -72,8 +72,8 @@ public SecurityFilterChain filterChain(HttpSecurity http, HandlerMappingIntrospe .requestMatchers(mvcMatcherBuilder.pattern("/swagger-ui/**")).permitAll() .requestMatchers(mvcMatcherBuilder.pattern("/swagger-resources/**")).permitAll() .requestMatchers(mvcMatcherBuilder.pattern("/v3/api-docs/**")).permitAll() - .requestMatchers(mvcMatcherBuilder.pattern("/api/sign-up/email")).permitAll() - .requestMatchers(mvcMatcherBuilder.pattern("/api/members/userName/isDuplicated")).permitAll() + .requestMatchers(mvcMatcherBuilder.pattern("/sign-up/email")).permitAll() + .requestMatchers(mvcMatcherBuilder.pattern("/members/userName/isDuplicated")).permitAll() .anyRequest().authenticated()) .oauth2Login(oauth2Login -> oauth2Login.successHandler(oAuth2LoginSuccessHandler) .failureHandler(oAuth2LoginFailureHandler) diff --git a/src/main/java/com/project/mapdagu/domain/auth/controller/AuthController.java b/src/main/java/com/project/mapdagu/domain/auth/controller/AuthController.java index ebadfe0..6b4ac98 100644 --- a/src/main/java/com/project/mapdagu/domain/auth/controller/AuthController.java +++ b/src/main/java/com/project/mapdagu/domain/auth/controller/AuthController.java @@ -23,7 +23,7 @@ @Tag(name = "Auth", description = "Auth API") @RestController @RequiredArgsConstructor -@RequestMapping("/api/auth") +@RequestMapping("/auth") public class AuthController { private final AuthService authService; diff --git a/src/main/java/com/project/mapdagu/domain/auth/controller/SignUpController.java b/src/main/java/com/project/mapdagu/domain/auth/controller/SignUpController.java index b13082d..cc53f39 100644 --- a/src/main/java/com/project/mapdagu/domain/auth/controller/SignUpController.java +++ b/src/main/java/com/project/mapdagu/domain/auth/controller/SignUpController.java @@ -24,7 +24,7 @@ @Tag(name = "Sign-Up", description = "Sign-Up API") @RestController @RequiredArgsConstructor -@RequestMapping("/api/sign-up") +@RequestMapping("/sign-up") public class SignUpController { private final AuthService authService; diff --git a/src/main/java/com/project/mapdagu/domain/auth/filter/CustomJsonAuthenticationFilter.java b/src/main/java/com/project/mapdagu/domain/auth/filter/CustomJsonAuthenticationFilter.java index f3d8a5d..6d8a3a7 100644 --- a/src/main/java/com/project/mapdagu/domain/auth/filter/CustomJsonAuthenticationFilter.java +++ b/src/main/java/com/project/mapdagu/domain/auth/filter/CustomJsonAuthenticationFilter.java @@ -17,7 +17,7 @@ public class CustomJsonAuthenticationFilter extends AbstractAuthenticationProcessingFilter { - private static final String DEFAULT_LOGIN_REQUEST_URL = "/login"; + private static final String DEFAULT_LOGIN_REQUEST_URL = "/auth/login"; private static final String HTTP_METHOD = "POST"; private static final String CONTENT_TYPE = "application/json"; private static final String USERNAME_KEY = "email"; // 회원 로그인 시 이메일 요청 JSON Key : "email" diff --git a/src/main/java/com/project/mapdagu/domain/evaluation/controller/EvaluationController.java b/src/main/java/com/project/mapdagu/domain/evaluation/controller/EvaluationController.java index 08a5516..2fc8a7e 100644 --- a/src/main/java/com/project/mapdagu/domain/evaluation/controller/EvaluationController.java +++ b/src/main/java/com/project/mapdagu/domain/evaluation/controller/EvaluationController.java @@ -30,7 +30,7 @@ @Tag(name = "Evaluation", description = "Evaluation API") @RestController @RequiredArgsConstructor -@RequestMapping("/api/evaluations") +@RequestMapping("/evaluations") public class EvaluationController { private final EvaluationService evaluationService; diff --git a/src/main/java/com/project/mapdagu/domain/food/controller/FoodController.java b/src/main/java/com/project/mapdagu/domain/food/controller/FoodController.java index 26b452b..c90bd29 100644 --- a/src/main/java/com/project/mapdagu/domain/food/controller/FoodController.java +++ b/src/main/java/com/project/mapdagu/domain/food/controller/FoodController.java @@ -28,7 +28,7 @@ @Tag(name = "Food", description = "Food API") @RestController @RequiredArgsConstructor -@RequestMapping("/api/foods") +@RequestMapping("/foods") public class FoodController { private final FoodService foodService; diff --git a/src/main/java/com/project/mapdagu/domain/friend/controller/FriendController.java b/src/main/java/com/project/mapdagu/domain/friend/controller/FriendController.java index 1719711..754528f 100644 --- a/src/main/java/com/project/mapdagu/domain/friend/controller/FriendController.java +++ b/src/main/java/com/project/mapdagu/domain/friend/controller/FriendController.java @@ -27,7 +27,7 @@ @Tag(name = "Friend", description = "Friend API") @RestController @RequiredArgsConstructor -@RequestMapping("/api/friends") +@RequestMapping("/friends") public class FriendController { private final FriendService friendService; diff --git a/src/main/java/com/project/mapdagu/domain/friendRequest/controller/FriendRequestController.java b/src/main/java/com/project/mapdagu/domain/friendRequest/controller/FriendRequestController.java index ccb9889..ac28f1c 100644 --- a/src/main/java/com/project/mapdagu/domain/friendRequest/controller/FriendRequestController.java +++ b/src/main/java/com/project/mapdagu/domain/friendRequest/controller/FriendRequestController.java @@ -22,7 +22,7 @@ @Tag(name = "Friend Request", description = "Friend Request API") @RestController @RequiredArgsConstructor -@RequestMapping("/api/friends/request") +@RequestMapping("/friends/request") public class FriendRequestController { private final FriendRequestService friendRequestService; diff --git a/src/main/java/com/project/mapdagu/domain/member/controller/MemberController.java b/src/main/java/com/project/mapdagu/domain/member/controller/MemberController.java index 6f44753..643b955 100644 --- a/src/main/java/com/project/mapdagu/domain/member/controller/MemberController.java +++ b/src/main/java/com/project/mapdagu/domain/member/controller/MemberController.java @@ -23,7 +23,7 @@ @Tag(name = "Member", description = "Member API") @RestController @RequiredArgsConstructor -@RequestMapping("/api/members") +@RequestMapping("/members") public class MemberController { private final MemberService memberService; diff --git a/src/main/java/com/project/mapdagu/domain/test/controller/TestController.java b/src/main/java/com/project/mapdagu/domain/test/controller/TestController.java index 797ca73..79ee471 100644 --- a/src/main/java/com/project/mapdagu/domain/test/controller/TestController.java +++ b/src/main/java/com/project/mapdagu/domain/test/controller/TestController.java @@ -20,7 +20,7 @@ @Tag(name = "Test", description = "Test API") @RestController @RequiredArgsConstructor -@RequestMapping("/api/test") +@RequestMapping("/test") public class TestController { private final TestService testService; diff --git a/src/main/java/com/project/mapdagu/jwt/filter/JwtAuthenticationProcessingFilter.java b/src/main/java/com/project/mapdagu/jwt/filter/JwtAuthenticationProcessingFilter.java index 7aa27d4..95147cb 100644 --- a/src/main/java/com/project/mapdagu/jwt/filter/JwtAuthenticationProcessingFilter.java +++ b/src/main/java/com/project/mapdagu/jwt/filter/JwtAuthenticationProcessingFilter.java @@ -37,7 +37,7 @@ @Slf4j public class JwtAuthenticationProcessingFilter extends OncePerRequestFilter { - private static final Set NO_CHECK_URLS = new HashSet<>(Arrays.asList("/login")); // "/login"으로 들어오는 요청은 Filter 작동 X + private static final Set NO_CHECK_URLS = new HashSet<>(Arrays.asList("/auth/login")); // "/login"으로 들어오는 요청은 Filter 작동 X private final JwtService jwtService; private final MemberRepository memberRepository; diff --git a/src/test/java/com/project/mapdagu/domain/auth/controller/AuthControllerTest.java b/src/test/java/com/project/mapdagu/domain/auth/controller/AuthControllerTest.java index 0c6d2ec..7f6b42e 100644 --- a/src/test/java/com/project/mapdagu/domain/auth/controller/AuthControllerTest.java +++ b/src/test/java/com/project/mapdagu/domain/auth/controller/AuthControllerTest.java @@ -45,7 +45,7 @@ void setUp() { //given //when ResultActions result = mockMvc.perform( - post("/api/auth/logout") + post("/auth/logout") ); //then result.andExpect(status().isNoContent()); diff --git a/src/test/java/com/project/mapdagu/domain/auth/controller/SignUpControllerTest.java b/src/test/java/com/project/mapdagu/domain/auth/controller/SignUpControllerTest.java index cf898a4..ba2cd4e 100644 --- a/src/test/java/com/project/mapdagu/domain/auth/controller/SignUpControllerTest.java +++ b/src/test/java/com/project/mapdagu/domain/auth/controller/SignUpControllerTest.java @@ -53,7 +53,7 @@ void setUp() { "intro"); //when ResultActions result = mockMvc.perform( - post("/api/sign-up") + post("/sign-up") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(requestDto)) ); @@ -73,7 +73,7 @@ void setUp() { ); //when ResultActions result = mockMvc.perform( - patch("/api/sign-up/social") + patch("/sign-up/social") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(requestDto)) ); diff --git a/src/test/java/com/project/mapdagu/domain/evaluation/controller/EvaluationControllerTest.java b/src/test/java/com/project/mapdagu/domain/evaluation/controller/EvaluationControllerTest.java index 39fe2f8..e072666 100644 --- a/src/test/java/com/project/mapdagu/domain/evaluation/controller/EvaluationControllerTest.java +++ b/src/test/java/com/project/mapdagu/domain/evaluation/controller/EvaluationControllerTest.java @@ -59,7 +59,7 @@ void setUp() { //when ResultActions result = mockMvc.perform( - post("/api/evaluations") + post("/evaluations") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(requestDto)) ); @@ -77,7 +77,7 @@ void setUp() { //when ResultActions result = mockMvc.perform( - patch("/api/evaluations/{evaluationId}", evaluationId) + patch("/evaluations/{evaluationId}", evaluationId) .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(requestDto)) ); @@ -94,7 +94,7 @@ void setUp() { //when ResultActions result = mockMvc.perform( - delete("/api/evaluations/{evaluationId}", evaluationId) + delete("/evaluations/{evaluationId}", evaluationId) .contentType(MediaType.APPLICATION_JSON) ); @@ -110,7 +110,7 @@ void setUp() { //when ResultActions result = mockMvc.perform( - patch("/api/evaluations/info") + patch("/evaluations/info") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(requestDto)) ); @@ -129,7 +129,7 @@ void setUp() { //when when(evaluationService.getOneEvaluation(anyString(), anyLong())).thenReturn(responseDto); ResultActions result = mockMvc.perform( - get("/api/evaluations/{evaluationId}", evaluationId) + get("/evaluations/{evaluationId}", evaluationId) ); //then @@ -149,7 +149,7 @@ void setUp() { //when given(evaluationService.getEvaluations(anyString(), any())).willReturn(response); ResultActions result = mockMvc.perform( - get("/api/evaluations/me") + get("/evaluations/me") ); //then @@ -169,7 +169,7 @@ void setUp() { //when given(evaluationService.searchEvaluation(anyString(), anyString(), any())).willReturn(response); ResultActions result = mockMvc.perform( - get("/api/evaluations") + get("/evaluations") .param("search", "라면") ); diff --git a/src/test/java/com/project/mapdagu/domain/food/controller/FoodControllerTest.java b/src/test/java/com/project/mapdagu/domain/food/controller/FoodControllerTest.java index 34eb3d7..b71d698 100644 --- a/src/test/java/com/project/mapdagu/domain/food/controller/FoodControllerTest.java +++ b/src/test/java/com/project/mapdagu/domain/food/controller/FoodControllerTest.java @@ -63,7 +63,7 @@ void setUp() { //when given(foodService.searchFood(anyString(), any())).willReturn(response); ResultActions result = mockMvc.perform( - get("/api/foods") + get("/foods") .param("search", "라면") ); @@ -80,7 +80,7 @@ void setUp() { //when given(foodService.searchFoodScoville(anyString())).willReturn(responseDto); ResultActions result = mockMvc.perform( - get("/api/foods/scoville") + get("/foods/scoville") .param("search", "신라면") ); @@ -98,7 +98,7 @@ void setUp() { //when when(foodService.getOneFood(anyString(), anyLong())).thenReturn(responseDto); ResultActions result = mockMvc.perform( - get("/api/foods/{foodId}", foodId) + get("/foods/{foodId}", foodId) ); //then diff --git a/src/test/java/com/project/mapdagu/domain/friend/controller/FriendControllerTest.java b/src/test/java/com/project/mapdagu/domain/friend/controller/FriendControllerTest.java index 245c06f..9a5a917 100644 --- a/src/test/java/com/project/mapdagu/domain/friend/controller/FriendControllerTest.java +++ b/src/test/java/com/project/mapdagu/domain/friend/controller/FriendControllerTest.java @@ -60,7 +60,7 @@ void setUp() { //when given(friendService.searchMember(anyString(), anyString(), any())).willReturn(response); ResultActions result = mockMvc.perform( - get("/api/friends") + get("/friends") .param("search", "test") ); @@ -76,7 +76,7 @@ void setUp() { // when ResultActions result = mockMvc.perform( - post("/api/friends/{friendId}", friendId) + post("/friends/{friendId}", friendId) ); //then @@ -91,7 +91,7 @@ void setUp() { // when ResultActions result = mockMvc.perform( - delete("/api/friends/{friendId}", friendId) + delete("/friends/{friendId}", friendId) ); //then @@ -111,7 +111,7 @@ void setUp() { //when given(friendService.getFriends(anyString(), any())).willReturn(response); ResultActions result = mockMvc.perform( - get("/api/friends/me") + get("/friends/me") ); //then diff --git a/src/test/java/com/project/mapdagu/domain/friendRequest/controller/FriendRequestControllerTest.java b/src/test/java/com/project/mapdagu/domain/friendRequest/controller/FriendRequestControllerTest.java index 3ff05f1..c08bfaa 100644 --- a/src/test/java/com/project/mapdagu/domain/friendRequest/controller/FriendRequestControllerTest.java +++ b/src/test/java/com/project/mapdagu/domain/friendRequest/controller/FriendRequestControllerTest.java @@ -54,7 +54,7 @@ void setUp() { // when ResultActions result = mockMvc.perform( - post("/api/friends/request/{friendId}", friendId) + post("/friends/request/{friendId}", friendId) ); //then @@ -69,7 +69,7 @@ void setUp() { // when ResultActions result = mockMvc.perform( - delete("/api/friends/request/{friendId}", friendId) + delete("/friends/request/{friendId}", friendId) ); //then @@ -89,7 +89,7 @@ void setUp() { //when given(friendRequestService.getAllFriendRequest(anyString(), any())).willReturn(response); ResultActions result = mockMvc.perform( - get("/api/friends/request") + get("/friends/request") ); //then diff --git a/src/test/java/com/project/mapdagu/domain/member/controller/MemberControllerTest.java b/src/test/java/com/project/mapdagu/domain/member/controller/MemberControllerTest.java index 4f001d4..36d75a4 100644 --- a/src/test/java/com/project/mapdagu/domain/member/controller/MemberControllerTest.java +++ b/src/test/java/com/project/mapdagu/domain/member/controller/MemberControllerTest.java @@ -67,7 +67,7 @@ void setUp() { //when ResultActions result = mockMvc.perform( - patch("/api/members/me/info") + patch("/members/me/info") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(requestDto)) ); @@ -85,7 +85,7 @@ void setUp() { //when given(memberService.readMemberInfo(anyString())).willReturn(response); ResultActions result = mockMvc.perform( - get("/api/members/me/info") + get("/members/me/info") ); //then @@ -101,7 +101,7 @@ void setUp() { //when given(memberService.readMainInfo(anyString())).willReturn(response); ResultActions result = mockMvc.perform( - get("/api/members/me/main") + get("/members/me/main") ); //then @@ -118,7 +118,7 @@ void setUp() { //when given(memberService.checkUserName(requestDto)).willReturn(response); ResultActions result = mockMvc.perform( - post("/api/members/userName/isDuplicated") + post("/members/userName/isDuplicated") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(requestDto)) ); diff --git a/src/test/java/com/project/mapdagu/domain/test/controller/TestControllerTest.java b/src/test/java/com/project/mapdagu/domain/test/controller/TestControllerTest.java index 1ac9931..e0d4ce9 100644 --- a/src/test/java/com/project/mapdagu/domain/test/controller/TestControllerTest.java +++ b/src/test/java/com/project/mapdagu/domain/test/controller/TestControllerTest.java @@ -52,7 +52,7 @@ void setUp() { //when ResultActions result = mockMvc.perform( - patch("/api/test/info") + patch("/test/info") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(requestDto)) ); @@ -73,7 +73,7 @@ void setUp() { //when ResultActions result = mockMvc.perform( - post("/api/test") + post("/test") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(requestDto)) ); @@ -93,7 +93,7 @@ void setUp() { //when ResultActions result = mockMvc.perform( - patch("/api/test") + patch("/test") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(requestDto)) );