Skip to content

Commit

Permalink
Merge pull request #192 from THEGOODs-repo/refactor/191
Browse files Browse the repository at this point in the history
โ™ป๏ธ Refactor: ์ƒํ’ˆ ์กฐํšŒ API ์ˆ˜์ •
  • Loading branch information
Eunjin3395 authored May 27, 2024
2 parents c240fbf + d005a05 commit db1f163
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ public WebSecurityCustomizer webSecurityCustomizer() {
"/api/members/email/auth", "/api/members/email/auth/verify", "/api/members/email/duplicate",
"/api/members/kakao/callback", "/api/members/naver/callback", "/api/members/nickname/duplicate",
"/api/members/password/update", "/api/members/phone/auth", "/api/members/phone/auth/**",
"/api/item/today", "/api/item/topsale", "/api/item/steady", "/api/count/tags/item",
"/api/delivery-date/item", "/api/item/main", "/api/item/{itemId}/related", "/api/order/api/nologin/order",
"/api/seller/item/{itemId}",
"/api/setItemData", "/api/search/item"
"/api/item/today", "/api/item/topsale",
"/api/item/main", "/api/item/{itemId}/related", "/api/order/api/nologin/order",
"/api/setItemData", "/api/search/item", "api/item/{itemId}"
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.umc.TheGoods.validation.annotation.ExistItem;
import com.umc.TheGoods.web.dto.item.ItemRequestDTO;
import com.umc.TheGoods.web.dto.item.ItemResponseDTO;
import com.umc.TheGoods.web.dto.member.MemberDetail;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
Expand Down Expand Up @@ -59,8 +58,8 @@ public ApiResponse<ItemResponseDTO.UploadItemResultDTO> upload(@RequestPart(valu
return ApiResponse.onSuccess(ItemConverter.toUploadItemResultDTO(item));
}

@GetMapping("/seller/item/{itemId}")
@Operation(summary = "์ƒํ’ˆ ์กฐํšŒ API", description = "์ƒํ’ˆ ์กฐํšŒ๋ฅผ ์œ„ํ•œ API์ด๋ฉฐ, path variable๋กœ ์ž…๋ ฅ ๊ฐ’์„ ๋ฐ›๋Š”๋‹ค. " +
@GetMapping("/item/{itemId}")
@Operation(summary = "์ƒํ’ˆ ์ƒ์„ธ ์กฐํšŒ API", description = "์ƒํ’ˆ ์ƒ์„ธ ์ •๋ณด ์กฐํšŒ๋ฅผ ์œ„ํ•œ API์ด๋ฉฐ, path variable๋กœ ์ž…๋ ฅ ๊ฐ’์„ ๋ฐ›๋Š”๋‹ค. " +
"itemId : ์กฐํšŒํ•  ์ƒํ’ˆ์˜ id")
@Parameters(value = {
@Parameter(name = "itemId", description = "์กฐํšŒํ•  ์ƒํ’ˆ์˜ id ์ž…๋‹ˆ๋‹ค.")
Expand Down Expand Up @@ -174,50 +173,50 @@ public ApiResponse<ItemResponseDTO.ItemPreviewListDTO> getTopSaleItemList(@Check
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("/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

0 comments on commit db1f163

Please sign in to comment.