diff --git a/warehouse/src/main/java/warehouse/common/exception/Goods/InvalidGoodsStatusException.java b/warehouse/src/main/java/warehouse/common/exception/Goods/InvalidGoodsStatusException.java index 48d650c0..896f4dc2 100644 --- a/warehouse/src/main/java/warehouse/common/exception/Goods/InvalidGoodsStatusException.java +++ b/warehouse/src/main/java/warehouse/common/exception/Goods/InvalidGoodsStatusException.java @@ -1,4 +1,4 @@ -package warehouse.common.exception.goods; +package warehouse.common.exception.Goods; import global.errorcode.ErrorCodeIfs; diff --git a/warehouse/src/main/java/warehouse/common/exception/GoodsExceptionHandler.java b/warehouse/src/main/java/warehouse/common/exception/GoodsExceptionHandler.java index 148f4fd6..bdcbac2d 100644 --- a/warehouse/src/main/java/warehouse/common/exception/GoodsExceptionHandler.java +++ b/warehouse/src/main/java/warehouse/common/exception/GoodsExceptionHandler.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; import warehouse.common.error.GoodsErrorCode; -import warehouse.common.exception.goods.InvalidGoodsStatusException; +import warehouse.common.exception.Goods.InvalidGoodsStatusException; import warehouse.common.exception.goods.GoodsNotFoundException; @Slf4j @@ -24,8 +24,7 @@ public ResponseEntity> imageException(GoodsNotFoundException e) { } @ExceptionHandler(value = InvalidGoodsStatusException.class) - public ResponseEntity> InvalidGoodsStatus( - warehouse.common.exception.goods.InvalidGoodsStatusException e) { + public ResponseEntity> InvalidGoodsStatus(InvalidGoodsStatusException e) { log.info("", e); return ResponseEntity.status(HttpStatus.BAD_REQUEST) .body(Api.ERROR(GoodsErrorCode.INVALID_GOODS_STATUS)); diff --git a/warehouse/src/main/java/warehouse/domain/goods/business/GoodsBusiness.java b/warehouse/src/main/java/warehouse/domain/goods/business/GoodsBusiness.java index 5aadb31f..6240e26c 100644 --- a/warehouse/src/main/java/warehouse/domain/goods/business/GoodsBusiness.java +++ b/warehouse/src/main/java/warehouse/domain/goods/business/GoodsBusiness.java @@ -29,23 +29,23 @@ public class GoodsBusiness { private final ImageService imageService; private final ImageConverter imageConverter; - public List> getGoodsList(GetGoodsStrategy strategy,Long requestId) { + public List getGoodsList(GetGoodsStrategy strategy,Long requestId) { List goodsList = findGoodsListById(strategy,requestId); return getGoodsResponsesBy(goodsList); } - public List> getGoodsList(GoodsStatus status) { + public List getGoodsList(GoodsStatus status) { List goodsList = goodsService.findAllByGoodsStatusWithThrow(status); return getGoodsResponsesBy(goodsList); } - private List> getGoodsResponsesBy(List goodsList) { + private List getGoodsResponsesBy(List goodsList) { - List> goodsResponse = new ArrayList<>(); + List goodsResponse = new ArrayList<>(); goodsList.forEach(goodsEntity -> { @@ -63,7 +63,7 @@ private List> getGoodsResponsesBy(List goodsLis ImageListResponse imageListResponse = imageConverter.toImageListResponse(basicList, faultList); - goodsResponse.add(goodsConverter.toResponseListBy(goodsList, imageListResponse)); + goodsResponse.add(goodsConverter.toResponse(goodsEntity, imageListResponse)); }); diff --git a/warehouse/src/main/java/warehouse/domain/goods/controller/GoodsController.java b/warehouse/src/main/java/warehouse/domain/goods/controller/GoodsController.java index 22a3267d..3c55ff86 100644 --- a/warehouse/src/main/java/warehouse/domain/goods/controller/GoodsController.java +++ b/warehouse/src/main/java/warehouse/domain/goods/controller/GoodsController.java @@ -21,14 +21,14 @@ public class GoodsController { private final GoodsBusiness goodsBusiness; @GetMapping("/{strategy}/{requestId}") - public Api>> receiving(@PathVariable GetGoodsStrategy strategy, @PathVariable Long requestId) { - List> response = goodsBusiness.getGoodsList(strategy,requestId); + public Api> receiving(@PathVariable GetGoodsStrategy strategy, @PathVariable Long requestId) { + List response = goodsBusiness.getGoodsList(strategy,requestId); return Api.OK(response); } @GetMapping() - public Api>> getGoodsByStatus(@RequestParam GoodsStatus status) { - List> response = goodsBusiness.getGoodsList(status); + public Api> getGoodsByStatus(@RequestParam GoodsStatus status) { + List response = goodsBusiness.getGoodsList(status); return Api.OK(response); } diff --git a/warehouse/src/main/java/warehouse/domain/goods/service/GoodsService.java b/warehouse/src/main/java/warehouse/domain/goods/service/GoodsService.java index 80325cfe..8e8d45df 100644 --- a/warehouse/src/main/java/warehouse/domain/goods/service/GoodsService.java +++ b/warehouse/src/main/java/warehouse/domain/goods/service/GoodsService.java @@ -10,8 +10,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import warehouse.common.error.GoodsErrorCode; +import warehouse.common.exception.Goods.InvalidGoodsStatusException; import warehouse.common.exception.goods.GoodsNotFoundException; -import warehouse.common.exception.goods.InvalidGoodsStatusException; @Service @RequiredArgsConstructor