From 9398be088fadc924e8783757daf369ce8d17aca5 Mon Sep 17 00:00:00 2001 From: haoxr <1490493387@qq.com> Date: Sat, 24 Dec 2022 10:23:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=B1=BB=E5=90=8D=E9=87=8D?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oms/controller/app/OrderController.java | 22 ++++++--------- .../youlai/mall/pms/api/SkuFeignClient.java | 4 +-- .../pojo/dto/{SkuInfoDTO.java => SkuDTO.java} | 2 +- .../admin/PmsCategoryController.java | 28 ++++++++++--------- .../controller/admin/PmsSkuController.java | 13 +++++---- .../controller/admin/PmsSpuController.java | 18 ++++++------ .../pms/controller/app/SkuController.java | 21 ++++++++------ .../pms/controller/app/SpuController.java | 4 +-- 8 files changed, 57 insertions(+), 55 deletions(-) rename mall-pms/pms-api/src/main/java/com/youlai/mall/pms/pojo/dto/{SkuInfoDTO.java => SkuDTO.java} (95%) diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/OrderController.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/OrderController.java index aa2dec1c5..a85b0d3e3 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/OrderController.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/OrderController.java @@ -4,13 +4,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.youlai.common.base.IBaseEnum; import com.youlai.common.result.PageResult; import com.youlai.common.result.Result; -import com.youlai.mall.oms.enums.PayTypeEnum; +import com.youlai.mall.oms.common.enums.PayTypeEnum; import com.youlai.mall.oms.pojo.entity.OmsOrder; import com.youlai.mall.oms.pojo.form.OrderSubmitForm; import com.youlai.mall.oms.pojo.query.OrderPageQuery; import com.youlai.mall.oms.pojo.vo.OrderConfirmVO; -import com.youlai.mall.oms.pojo.vo.OrderSubmitVO; -import com.youlai.mall.oms.service.IOrderService; +import com.youlai.mall.oms.pojo.vo.OrderSubmitResultVO; +import com.youlai.mall.oms.service.OrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -19,20 +19,20 @@ import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import javax.validation.Valid; - /** + * 「移动端」订单控制层 + * * @author huawei * @email huawei_code@163.com * @date 2020-12-30 22:31:10 */ -@Api(tags = "「移动端」订单管理") +@Api(tags = "「移动端」订单接口") @RestController @RequestMapping("/app-api/v1/orders") @RequiredArgsConstructor public class OrderController { - final IOrderService orderService; + final OrderService orderService; @ApiOperation("分页列表") @GetMapping @@ -60,7 +60,7 @@ public class OrderController { @ApiOperation("订单提交") @PostMapping("/_submit") public Result submitOrder(@RequestBody @Validated OrderSubmitForm orderSubmitForm) { - OrderSubmitVO result = orderService.submitOrder(orderSubmitForm); + OrderSubmitResultVO result = orderService.submitOrder(orderSubmitForm); return Result.success(result); } @@ -83,10 +83,4 @@ public class OrderController { return Result.judge(result); } - @ApiOperation("订单取消") - @PutMapping("/cancel") - public Result cancel(@RequestParam Long id) { - boolean result = orderService.cancelOrder(id); - return Result.judge(result); - } } diff --git a/mall-pms/pms-api/src/main/java/com/youlai/mall/pms/api/SkuFeignClient.java b/mall-pms/pms-api/src/main/java/com/youlai/mall/pms/api/SkuFeignClient.java index ddf12078b..f4ec3cb78 100644 --- a/mall-pms/pms-api/src/main/java/com/youlai/mall/pms/api/SkuFeignClient.java +++ b/mall-pms/pms-api/src/main/java/com/youlai/mall/pms/api/SkuFeignClient.java @@ -2,7 +2,7 @@ package com.youlai.mall.pms.api; import com.youlai.common.result.Result; import com.youlai.mall.pms.pojo.dto.CheckPriceDTO; -import com.youlai.mall.pms.pojo.dto.SkuInfoDTO; +import com.youlai.mall.pms.pojo.dto.SkuDTO; import com.youlai.mall.pms.pojo.dto.LockStockDTO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.*; @@ -15,7 +15,7 @@ public interface SkuFeignClient { * 获取商品库存单元信息 */ @GetMapping("/app-api/v1/sku/{skuId}/info") - Result getSkuInfo(@PathVariable Long skuId); + Result getSkuInfo(@PathVariable Long skuId); /** * 锁定商品库存 diff --git a/mall-pms/pms-api/src/main/java/com/youlai/mall/pms/pojo/dto/SkuInfoDTO.java b/mall-pms/pms-api/src/main/java/com/youlai/mall/pms/pojo/dto/SkuDTO.java similarity index 95% rename from mall-pms/pms-api/src/main/java/com/youlai/mall/pms/pojo/dto/SkuInfoDTO.java rename to mall-pms/pms-api/src/main/java/com/youlai/mall/pms/pojo/dto/SkuDTO.java index 5787fe496..026cbb4da 100644 --- a/mall-pms/pms-api/src/main/java/com/youlai/mall/pms/pojo/dto/SkuInfoDTO.java +++ b/mall-pms/pms-api/src/main/java/com/youlai/mall/pms/pojo/dto/SkuDTO.java @@ -10,7 +10,7 @@ import lombok.Data; */ @Data -public class SkuInfoDTO { +public class SkuDTO { /** * skuId */ diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/PmsCategoryController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/PmsCategoryController.java index 13457eaec..560cee516 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/PmsCategoryController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/PmsCategoryController.java @@ -4,11 +4,12 @@ import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.youlai.common.result.Result; +import com.youlai.common.web.model.Option; import com.youlai.mall.pms.pojo.entity.PmsCategoryAttribute; import com.youlai.mall.pms.pojo.entity.PmsCategory; import com.youlai.mall.pms.pojo.vo.CategoryVO; -import com.youlai.mall.pms.service.IPmsAttributeService; -import com.youlai.mall.pms.service.IPmsCategoryService; +import com.youlai.mall.pms.service.AttributeService; +import com.youlai.mall.pms.service.CategoryService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; @@ -32,20 +33,20 @@ import java.util.List; @RequiredArgsConstructor public class PmsCategoryController { - private final IPmsCategoryService iPmsCategoryService; - private final IPmsAttributeService iPmsAttributeService; + private final CategoryService categoryService; + private final AttributeService attributeService; @ApiOperation(value = "商品分类列表") @GetMapping public Result> list() { - List list = iPmsCategoryService.listCategory(null); + List list = categoryService.listCategory(null); return Result.success(list); } @ApiOperation(value = "商品分类级联列表") @GetMapping("/options") public Result listCategoryOptions() { - List list = iPmsCategoryService.listCategoryOptions(); + List