Skip to content

Commit

Permalink
chore: 서브 도메인 설정 후 uri 변경 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyeong-hyeok committed Nov 30, 2023
1 parent 251968d commit 6c3426c
Show file tree
Hide file tree
Showing 20 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/project/mapdagu/MapdaguApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/project/mapdagu/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@Tag(name = "Auth", description = "Auth API")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/auth")
@RequestMapping("/auth")
public class AuthController {

private final AuthService authService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@Tag(name = "Evaluation", description = "Evaluation API")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/evaluations")
@RequestMapping("/evaluations")
public class EvaluationController {

private final EvaluationService evaluationService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@Tag(name = "Food", description = "Food API")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/foods")
@RequestMapping("/foods")
public class FoodController {

private final FoodService foodService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@Tag(name = "Friend", description = "Friend API")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/friends")
@RequestMapping("/friends")
public class FriendController {

private final FriendService friendService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@Tag(name = "Member", description = "Member API")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/members")
@RequestMapping("/members")
public class MemberController {

private final MemberService memberService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@Tag(name = "Test", description = "Test API")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/test")
@RequestMapping("/test")
public class TestController {

private final TestService testService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
@Slf4j
public class JwtAuthenticationProcessingFilter extends OncePerRequestFilter {

private static final Set<String> NO_CHECK_URLS = new HashSet<>(Arrays.asList("/login")); // "/login"으로 들어오는 요청은 Filter 작동 X
private static final Set<String> NO_CHECK_URLS = new HashSet<>(Arrays.asList("/auth/login")); // "/login"으로 들어오는 요청은 Filter 작동 X

private final JwtService jwtService;
private final MemberRepository memberRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void setUp() {
//given
//when
ResultActions result = mockMvc.perform(
post("/api/auth/logout")
post("/auth/logout")
);
//then
result.andExpect(status().isNoContent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
);
Expand All @@ -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))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void setUp() {

//when
ResultActions result = mockMvc.perform(
post("/api/evaluations")
post("/evaluations")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(requestDto))
);
Expand All @@ -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))
);
Expand All @@ -94,7 +94,7 @@ void setUp() {

//when
ResultActions result = mockMvc.perform(
delete("/api/evaluations/{evaluationId}", evaluationId)
delete("/evaluations/{evaluationId}", evaluationId)
.contentType(MediaType.APPLICATION_JSON)
);

Expand All @@ -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))
);
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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", "라면")
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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", "라면")
);

Expand All @@ -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", "신라면")
);

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
);

Expand All @@ -76,7 +76,7 @@ void setUp() {

// when
ResultActions result = mockMvc.perform(
post("/api/friends/{friendId}", friendId)
post("/friends/{friendId}", friendId)
);

//then
Expand All @@ -91,7 +91,7 @@ void setUp() {

// when
ResultActions result = mockMvc.perform(
delete("/api/friends/{friendId}", friendId)
delete("/friends/{friendId}", friendId)
);

//then
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void setUp() {

// when
ResultActions result = mockMvc.perform(
post("/api/friends/request/{friendId}", friendId)
post("/friends/request/{friendId}", friendId)
);

//then
Expand All @@ -69,7 +69,7 @@ void setUp() {

// when
ResultActions result = mockMvc.perform(
delete("/api/friends/request/{friendId}", friendId)
delete("/friends/request/{friendId}", friendId)
);

//then
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
);
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
);
Expand All @@ -73,7 +73,7 @@ void setUp() {

//when
ResultActions result = mockMvc.perform(
post("/api/test")
post("/test")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(requestDto))
);
Expand All @@ -93,7 +93,7 @@ void setUp() {

//when
ResultActions result = mockMvc.perform(
patch("/api/test")
patch("/test")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(requestDto))
);
Expand Down

0 comments on commit 6c3426c

Please sign in to comment.