Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

@Tag(name = "Bookmark API", description = "북마크 API")
@RestController
@RequestMapping("/bookmarks")
@RequestMapping("/v1/users/me/bookmarks")
@RequiredArgsConstructor
public class BookmarkController {
private final BookmarkService bookmarkService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.requestMatchers(
"/oauth2/authorization/kakao", // 카카오 로그인 요청
"/login/oauth2/code/**", // 카카오 인증 콜백
"/api/refresh-token", // refresh token (토큰 갱신)
"/v2/app/oauth/kakao/login", // 카카오 앱 로그인
"/v1/menus/**", // 모든 메뉴 조회
"/v1/store-payments/**", // 결제 관련 API
"/v1/auth/token/refresh", // refresh token (토큰 갱신)
"/v1/auth/app/kakao/login", // 카카오 앱 로그인
"/v1/stores/*/menus/**", // 모든 메뉴 조회
"/v1/stores/*/payments/**", // 결제 관련 API
"/orders/**",
"/swagger-ui/**",
"/v3/api-docs/**",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

@Tag(name = "Menu API", description = "메뉴 API")
@RestController
@RequestMapping("/v1/menus")
@RequestMapping("/v1/stores/{publicCode}/menus")
@RequiredArgsConstructor
@Slf4j
public class MenuController {

private final MenuService menuService;

@GetMapping("/all-menus/stores/{publicCode}")
@GetMapping
@Operation(summary = "가게의 모든 메뉴 조회", description = "특정 가게의 모든 메뉴를 조회합니다.")
@ApiResponse(responseCode = "200", description = "모든 메뉴를 조회 성공")
public ResponseEntity<?> getMenusByStoreId(@PathVariable String publicCode) {
Expand All @@ -38,7 +38,7 @@ public ResponseEntity<?> getMenusByStoreId(@PathVariable String publicCode) {
);
}

@GetMapping("/{publicCode}/{menuId}")
@GetMapping("/{menuId}")
@Operation(
summary = "메뉴 ID로 메뉴 조회", description = "특정 가게의 특정 메뉴를 ID로 조회합니다.")
@ApiResponse(responseCode = "200", description = "메뉴 조회 성공")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import lombok.RequiredArgsConstructor;

@RestController
@RequestMapping("/v2/app/oauth/kakao")
@RequestMapping("/v1/auth/app/kakao")
@RequiredArgsConstructor
public class KakaoAppAuthController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,12 @@

@Tag(name = "Order API", description = "주문 API")
@RestController
@RequestMapping("/orders")
@RequestMapping("/v1/stores/{publicCode}/tables/{tableId}/orders")
@RequiredArgsConstructor
public class OrderController {
private final OrderService orderService;

// @PostMapping("/create/{storeId}/{tableId}")
// @Operation(summary = "주문 생성", description = "특정 주점 - 특정 테이블에 대한 주문 생성")
// @ApiResponse(responseCode = "201", description = "주문 생성")
// public ResponseEntity<?> createOrder(
// @PathVariable Long storeId,
// @PathVariable Long tableId,
// @RequestBody @Valid OrderCreateRequestDto orderCreateRequestDto,
// HttpSession session
// ) {
// String sessionId = session.getId();
// OrderCreateResponseDto response = orderService.createOrder(storeId, tableId, orderCreateRequestDto, sessionId);
// return ResponseEntity
// .status(HttpStatus.CREATED)
// .body(
// ApiUtils.success(response)
// );
// }

@PostMapping("/create/{publicCode}/{tableId}")
@PostMapping
@Operation(summary = "주문 생성", description = "특정 주점 - 특정 테이블에 대한 주문 생성")
@ApiResponse(responseCode = "201", description = "주문 생성")
public ResponseEntity<?> createOrder(
Expand All @@ -69,7 +51,7 @@ public ResponseEntity<?> createOrder(
);
}

@GetMapping("/items/{publicCode}/{tableId}")
@GetMapping
@Operation(summary = "테이블별 주문 아이템 조회", description = "비로그인(세션) 기준으로 테이블의 내 주문 목록만 조회")
@ApiResponse(responseCode = "200", description = "주문 조회")
public ResponseEntity<?> getOrderItems(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@

@Tag(name = "Reservation API", description = "예약 API")
@RestController
@RequestMapping("/reservations")
@RequestMapping("/v1/users/me/waitings")
@RequiredArgsConstructor
public class ReservationController {

private final ReservationService reservationService;

@PostMapping("/create/{storeId}")
// 성능 비교를 위해 남겨둔 레거시 웨이팅 등록 API
@PostMapping("/legacy/{storeId}")
@Operation(summary = "웨이팅 등록", description = "특정 주점에 대한 웨이팅 등록 레거시")
public ResponseEntity<?> create(
@PathVariable Long storeId,
@AuthenticationPrincipal CustomOAuth2User customOAuth2User,
Expand All @@ -49,7 +51,7 @@ public ResponseEntity<?> create(
);
}

@PostMapping("/create/redis/{storeId}")
@PostMapping("/{storeId}")
@Operation(summary = "대기열 등록", description = "특정 주점에 대한 대기열 등록")
@ApiResponse(responseCode = "201", description = "대기열 등록")
public ResponseEntity<?> createQueue(
Expand All @@ -67,7 +69,7 @@ public ResponseEntity<?> createQueue(
);
}

@GetMapping("/get/queue/redis/{storeId}")
@GetMapping("/{storeId}")
@Operation(summary = "특정 주점의 본인 대기열 조회", description = "특정 주점에 대한 본인 대기열 조회")
@ApiResponse(responseCode = "200", description = "본인 대기열 조회")
public ResponseEntity<?> getQueue(
Expand All @@ -84,7 +86,8 @@ public ResponseEntity<?> getQueue(
);
}

@DeleteMapping("/delete/queue/redis/{storeId}")
// TODO : 대기열 취소 시 예약 번호 사용하도록 변경 (현재는 주점 아이디로 처리 중)
@DeleteMapping("/{storeId}")
@Operation(summary = "내 대기열 취소", description = "특정 주점에 대한 대기열 취소")
@ApiResponse(responseCode = "200", description = "대기열 취소")
public ResponseEntity<?> deleteQueue(
Expand All @@ -100,7 +103,7 @@ public ResponseEntity<?> deleteQueue(
);
}

@GetMapping("/my/waitings")
@GetMapping
@Operation(summary = "내 모든 대기열 리스트 확인", description = "내가 신청한 모든 대기열 리스트 확인")
@ApiResponse(responseCode = "200", description = "대기열 리스트 조회")
public ResponseEntity<?> getAllMyWaitings(@AuthenticationPrincipal CustomOAuth2User customOAuth2User) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,18 @@

@Tag(name = "Store API", description = "주점(Store) API")
@RestController
@RequestMapping("v1/stores")
@RequestMapping("/v1/stores")
@RequiredArgsConstructor
@Slf4j
public class StoreController {

private final StoreService storeService;


@GetMapping("/all-stores")
@Operation(
summary = "모든 주점 페이지네이션 조회",
description = "모든 주점을 페이지네이션으로 조회합니다."
)
@GetMapping
@Operation(summary = "모든 주점 페이지네이션 조회", description = "모든 주점을 페이지네이션으로 조회합니다.")
@ApiResponse(responseCode = "200", description = "모든 주점 페이지네이션 조회 성공")
public ResponseEntity<?> getAllStoresByPageAndDeparments(Pageable pageable, @AuthenticationPrincipal CustomOAuth2User customOAuth2User) {
public ResponseEntity<?> getAllStoresByPageAndDepartments(Pageable pageable, @AuthenticationPrincipal CustomOAuth2User customOAuth2User) {
return ResponseEntity
.ok()
.body(
Expand Down Expand Up @@ -72,7 +69,7 @@ public ResponseEntity<?> searchStores(@RequestParam("keyword") String keyword) {
);
}

@GetMapping("/waiting-list")
@GetMapping("/waiting-count")
@Operation(summary = "예약 많은순/적은순 주점 리스트 조회", description = "desc(대기 많은순) , asc(대기 적은순)")
@ApiResponse(responseCode = "200", description = "주점 대기순 정렬")
public ResponseEntity<?> getStoreWaitingList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,29 @@

@Tag(name = "Store Payment API", description = "주점 결제 정보 API")
@RestController
@RequestMapping("v1/store-payments")
@RequestMapping("/v1/stores/{publicCode}/payments")
@RequiredArgsConstructor
@Slf4j
public class StorePaymentController {

private final StorePaymentService storePaymentService;

@GetMapping(("/{publicCode}"))
@GetMapping
@Operation(summary = "주점 결제 정보 조회", description = "주점 ID로 주점 결제 정보를 조회합니다.")
@ApiResponse(responseCode = "200", description = "주점 결제 정보 조회 성공")
@ApiResponse(responseCode = "204", description = "결제 정보 없음")
public ResponseEntity<?> getStorePaymentByStoreId(@PathVariable String publicCode) {
Optional<StorePaymentReadDto> response = storePaymentService.getStorePaymentByStoreId(publicCode);

if (response.isPresent()) {
return ResponseEntity
return storePaymentService.getStorePaymentByStoreId(publicCode)
.map(response -> ResponseEntity
.status(HttpStatus.OK)
.body(
ApiUtils.success(
response
)
))
.orElseGet(() -> ResponseEntity
.status(HttpStatus.NO_CONTENT).build()
);
} else {
return ResponseEntity
.status(HttpStatus.OK)
.body(
ApiUtils.success(
"해당 주점의 등록된 결제 정보가 존재하지 않습니다."
)
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/refresh-token")
@RequestMapping("/v1/auth/token/refresh")
@Slf4j
public class TokenController {
private final JwtUtil jwtUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
import lombok.RequiredArgsConstructor;

@RestController
@RequestMapping("/users")
@RequestMapping("/v1/users/me")
@RequiredArgsConstructor
public class UserController {

private final UserService userService;

@PutMapping("/optional-info")
// TODO : Pathch로 변경 고려 및 토큰 전달 방식 변경 고려 (SecurityContext)
@PutMapping("/optional")
public ResponseEntity<?> putOptional(
@Valid @RequestBody UserUpdateRequest req) {
@Valid @RequestBody UserUpdateRequest request) {

AuthenticationResponse authenticationResponse = userService.putOptional(req.phoneNumber(),
Boolean.TRUE.equals(req.consent()), req.accessToken());
AuthenticationResponse authenticationResponse = userService.putOptional(request.phoneNumber(),
Boolean.TRUE.equals(request.consent()), request.accessToken());

return ResponseEntity
.status(HttpStatus.OK)
Expand Down