Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ”¨[refactor] μƒν’ˆ μΆ”μ²œ api μ•Œκ³ λ¦¬μ¦˜ μˆ˜μ • 및 λΉ„νšŒμ› κ΄€λ ¨ κΈ°λŠ₯ μˆ˜μ • #198

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,101 +122,6 @@ public ApiResponse<ItemResponseDTO.ItemPreviewListDTO> getMyItemList(@CheckPage
return ApiResponse.onSuccess(ItemConverter.itemPreviewListDTO(itemList));
}

@GetMapping("/item/today")
@Operation(summary = "였늘의 μƒν’ˆ μΆ”μ²œ API", description = "였늘의 μƒν’ˆμœΌλ‘œ μ„ μ •λœ μƒν’ˆλ“€μ„ μ‘°νšŒν•˜λŠ” API μž…λ‹ˆλ‹€. \n\n" +
"page : μƒν’ˆ 쑰회 νŽ˜μ΄μ§€ 번호")
@Parameters(value = {
@Parameter(name = "page", description = "νŽ˜μ΄μ§€ 번호, 1 μ΄μƒμ˜ 숫자λ₯Ό μž…λ ₯ν•΄μ£Όμ„Έμš”."),
})
public ApiResponse<ItemResponseDTO.ItemPreviewListDTO> getTodayItemList(@CheckPage @RequestParam Integer page) {

Page<Item> itemPage = itemQueryService.getTodayItemList(page - 1);

return ApiResponse.onSuccess(ItemConverter.itemPreviewListDTO(itemPage));
}

@GetMapping("/similar/item")
@Operation(summary = "방금 λ³Έ μƒν’ˆκ³Ό μœ μ‚¬ν•œ μƒν’ˆ μΆ”μ²œ API", description = "직전에 μ‘°νšŒν•œ μƒν’ˆκ³Ό λ™μΌν•œ μΉ΄ν…Œκ³ λ¦¬λ₯Ό 가진 μƒν’ˆμ„ μ‘°νšŒν•˜λŠ” API이며, request parameter둜 μž…λ ₯ 값을 λ°›μŠ΅λ‹ˆλ‹€. \n\n" +
"page : μƒν’ˆ 쑰회 νŽ˜μ΄μ§€ 번호 \n\n itemId : μƒν’ˆ id(Long)")
@Parameters(value = {
@Parameter(name = "page", description = "νŽ˜μ΄μ§€ 번호, 1 μ΄μƒμ˜ 숫자λ₯Ό μž…λ ₯ν•΄μ£Όμ„Έμš”."),
@Parameter(name = "itemId", description = "μƒν’ˆ 아이디, νšŒμ›μΈ 경우 μž…λ ₯ν•  ν•„μš”κ°€ μ—†μœΌλ©°, λΉ„νšŒμ›μΈ 경우 ν•„μˆ˜λ‘œ μž…λ ₯ν•΄μ£Όμ„Έμš”.")
})
@ApiResponses({
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성곡")
})
public ApiResponse<ItemResponseDTO.ItemPreviewListDTO> similarItemList(@CheckPage @RequestParam Integer page,
@RequestParam(name = "itemId", required = false) Long itemId,
Authentication authentication) {
Member member;

if (authentication == null) {
member = memberQueryService.findMemberByNickname("no_login_user").orElseThrow(() -> new ItemHandler(ErrorStatus.ITEM_VIEW_ERROR));
} else {
member = memberQueryService.findMemberById(Long.valueOf(authentication.getName().toString())).orElseThrow(() -> new MemberHandler(ErrorStatus.MEMBER_NOT_FOUND));
}
Page<Item> itemPage = itemQueryService.getSimilarItemList(itemId, member, page - 1);

return ApiResponse.onSuccess(ItemConverter.itemPreviewListDTO(itemPage));
}

@GetMapping("/item/topsale")
@Operation(summary = "κ°€μž₯ 많이 판맀된 μƒν’ˆ μΆ”μ²œ API", description = "판맀수 순으둜 μƒν’ˆμ„ μ •λ ¬ν•΄ μ‘°νšŒν•˜λŠ” API μž…λ‹ˆλ‹€. \n\n" +
"page : μƒν’ˆ 쑰회 νŽ˜μ΄μ§€ 번호")
@Parameters(value = {
@Parameter(name = "page", description = "νŽ˜μ΄μ§€ 번호, 1 μ΄μƒμ˜ 숫자λ₯Ό μž…λ ₯ν•΄μ£Όμ„Έμš”."),
})
public ApiResponse<ItemResponseDTO.ItemPreviewListDTO> getTopSaleItemList(@CheckPage @RequestParam Integer page,
Authentication authentication) {

Page<Item> itemPage = itemQueryService.getTopSaleItemList(page - 1);
return ApiResponse.onSuccess(ItemConverter.itemPreviewListDTO(itemPage));
}

// @GetMapping("/item/steady")
// @Operation(summary = "κΎΈμ€€νžˆ μ‚¬λž‘λ°›λŠ” μƒν’ˆ μΆ”μ²œ API", description = "판맀 μ‹œμž‘μΌμ΄ 6κ°œμ›” 이전인 μƒν’ˆμ„ 쑰회수 순으둜 μ •λ ¬ν•΄ μ‘°νšŒν•˜λŠ” API μž…λ‹ˆλ‹€. \n\n" +
// "page : μƒν’ˆ 쑰회 νŽ˜μ΄μ§€ 번호")
// @Parameters(value = {
// @Parameter(name = "page", description = "νŽ˜μ΄μ§€ 번호, 1 μ΄μƒμ˜ 숫자λ₯Ό μž…λ ₯ν•΄μ£Όμ„Έμš”."),
// })
// public ApiResponse<ItemResponseDTO.ItemPreviewListDTO> getSteadySaleItemList(@CheckPage @RequestParam Integer page,
// Authentication authentication) {
// Page<Item> itemPage = itemQueryService.getSteadySaleItemList(page - 1);
//
// return ApiResponse.onSuccess(ItemConverter.itemPreviewListDTO(itemPage));
// }

// @GetMapping("/count/tags/item")
// @Operation(summary = "νƒœκ·Έκ°€ 많이 λ‹¬λ €μžˆλŠ” μƒν’ˆ μΆ”μ²œ API", description = "νƒœκ·Έκ°€ 많이 λ‹¬λ €μžˆλŠ” μƒν’ˆμ„ μ‘°νšŒν•˜λŠ” API이며, request parameter둜 μž…λ ₯ 값을 λ°›μŠ΅λ‹ˆλ‹€. \n\n" +
// "page : μƒν’ˆ 쑰회 νŽ˜μ΄μ§€ 번호")
// @Parameters(value = {
// @Parameter(name = "page", description = "νŽ˜μ΄μ§€ 번호, 1 μ΄μƒμ˜ 숫자λ₯Ό μž…λ ₯ν•΄μ£Όμ„Έμš”."),
// })
// @ApiResponses({
// @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성곡")
// })
// public ApiResponse<ItemResponseDTO.ItemPreviewListDTO> tagCountItemList(@CheckPage @RequestParam Integer page) {
//
// Page<Item> itemPage = itemQueryService.getItemByTagCount(page - 1);
//
// return ApiResponse.onSuccess(ItemConverter.itemPreviewListDTO(itemPage));
// }

// @GetMapping("/delivery-date/item")
// @Operation(summary = "배솑기간이 λΉ λ₯Έ μƒν’ˆ μΆ”μ²œ API", description = "배솑기간이 λΉ λ₯Έ μƒν’ˆμ„ μ‘°νšŒν•˜λŠ” API이며, request parameter둜 μž…λ ₯ 값을 λ°›μŠ΅λ‹ˆλ‹€. \n\n" +
// "page : μƒν’ˆ 쑰회 νŽ˜μ΄μ§€ 번호")
// @Parameters(value = {
// @Parameter(name = "page", description = "νŽ˜μ΄μ§€ 번호, 1 μ΄μƒμ˜ 숫자λ₯Ό μž…λ ₯ν•΄μ£Όμ„Έμš”."),
// })
// @ApiResponses({
// @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성곡")
// })
// public ApiResponse<ItemResponseDTO.ItemPreviewListDTO> deliveryDateItemList(@CheckPage @RequestParam Integer page) {
//
// Page<Item> itemPage = itemQueryService.getItemByDeliveryDate(page - 1);
//
// return ApiResponse.onSuccess(ItemConverter.itemPreviewListDTO(itemPage));
// }

@GetMapping("/search/item")
@Operation(summary = "판맀 μƒν’ˆ 검색 API", description = "μƒν’ˆ 검색을 μœ„ν•œ API이며, request parameter둜 μž…λ ₯ 값을 λ°›μŠ΅λ‹ˆλ‹€. \n\n" +
Expand Down
Loading