From 481612ef501f561cca597caa1dc79d9caa523e62 Mon Sep 17 00:00:00 2001 From: "DESKTOP-6ARNG1Q\\dlsgk" Date: Mon, 28 Oct 2024 15:49:00 +0900 Subject: [PATCH] =?UTF-8?q?item=20=EC=A1=B0=ED=9A=8C=20api=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../displayItem/DisplayItemController.java | 17 ++++++ .../biz/displayItem/DisplayItemMapper.java | 7 +++ .../biz/displayItem/DisplayItemService.java | 10 ++++ .../mappers/displayItem/displayItemMapper.xml | 55 +++++++++++++++++++ 4 files changed, 89 insertions(+) diff --git a/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemController.java b/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemController.java index cb5993e7..a5da9ee9 100644 --- a/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemController.java +++ b/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemController.java @@ -1,8 +1,10 @@ package com.interplug.qcast.biz.displayItem; import com.interplug.qcast.biz.displayItem.dto.DisplayItemRequest; +import com.interplug.qcast.biz.displayItem.dto.ItemResponse; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import java.util.List; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; @@ -23,4 +25,19 @@ public class DisplayItemController { throws Exception { displayItemService.setStoreDisplayItemSave(displayItemRequest); } + + @Operation(description = "제품 목록을 조회한다.") + @GetMapping("/item_list") + @ResponseStatus(HttpStatus.OK) + public List getItemList(@RequestParam("saleStoreId") String saleStoreId) + throws Exception { + return displayItemService.getItemList(saleStoreId); + } + + @Operation(description = "제품 상세 정보를 조회한다.") + @GetMapping("/item_detail") + @ResponseStatus(HttpStatus.OK) + public ItemResponse getItemDetail(@RequestParam("itemId") String itemId) throws Exception { + return displayItemService.getItemDetail(itemId); + } } diff --git a/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemMapper.java b/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemMapper.java index 9c1bf003..59244c97 100644 --- a/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemMapper.java +++ b/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemMapper.java @@ -1,10 +1,17 @@ package com.interplug.qcast.biz.displayItem; import com.interplug.qcast.biz.displayItem.dto.DisplayItemRequest; +import com.interplug.qcast.biz.displayItem.dto.ItemResponse; +import java.util.List; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; @Mapper public interface DisplayItemMapper { void setStoreDisplayItemSave(DisplayItemRequest displayItemRequest) throws Exception; + + List getItemList(@Param("saleStoreId") String saleStoreId); + + ItemResponse getItemDetail(@Param("itemId") String itemId); } diff --git a/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemService.java b/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemService.java index c74ad7aa..01a5c442 100644 --- a/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemService.java +++ b/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemService.java @@ -1,6 +1,8 @@ package com.interplug.qcast.biz.displayItem; import com.interplug.qcast.biz.displayItem.dto.DisplayItemRequest; +import com.interplug.qcast.biz.displayItem.dto.ItemResponse; +import java.util.List; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -15,4 +17,12 @@ public class DisplayItemService { public void setStoreDisplayItemSave(DisplayItemRequest displayItemRequest) throws Exception { displayItemMapper.setStoreDisplayItemSave(displayItemRequest); } + + public List getItemList(String saleStoreId) { + return displayItemMapper.getItemList(saleStoreId); + } + + public ItemResponse getItemDetail(String itemId) { + return displayItemMapper.getItemDetail(itemId); + } } diff --git a/src/main/resources/mappers/displayItem/displayItemMapper.xml b/src/main/resources/mappers/displayItem/displayItemMapper.xml index b84cba3a..43fb59f2 100644 --- a/src/main/resources/mappers/displayItem/displayItemMapper.xml +++ b/src/main/resources/mappers/displayItem/displayItemMapper.xml @@ -43,4 +43,59 @@ , #{lastEditDatetime} ); + + + + +