diff --git a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/dto/OrderItemDTO.java b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/dto/OrderItemDTO.java new file mode 100644 index 000000000..2a507f099 --- /dev/null +++ b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/dto/OrderItemDTO.java @@ -0,0 +1,20 @@ +package com.youlai.mall.oms.pojo.dto; + +import com.youlai.common.base.BaseVO; +import lombok.*; + +/** + * 订单商品 + */ +@Builder +@Data +@NoArgsConstructor +@AllArgsConstructor +public class OrderItemDTO extends BaseVO { + + private Long skuId; + private Integer count; + private String pic; + private String title; + private Long price; +} diff --git a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/dto/OrderSubmitDTO.java b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/dto/OrderSubmitDTO.java index 4f128deaa..acbd89244 100644 --- a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/dto/OrderSubmitDTO.java +++ b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/dto/OrderSubmitDTO.java @@ -1,12 +1,9 @@ package com.youlai.mall.oms.pojo.dto; -import com.youlai.mall.oms.pojo.vo.OrderItemVO; import com.youlai.mall.ums.pojo.domain.UmsAddress; import lombok.Data; -import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; -import java.math.BigDecimal; import java.util.List; /** @@ -21,7 +18,7 @@ public class OrderSubmitDTO { // 提交订单确认页面签发的令牌 private String orderToken; - private List orderItems; + private List orderItems; // 验价前台传值 private Long totalPrice; @@ -29,13 +26,11 @@ public class OrderSubmitDTO { // 收货地址 private UmsAddress deliveryAddress; - @Size(max = 500, message = "订单备注长度不能超过500") private String remark; + private String couponId; private Long payAmount; - private String couponId; - } diff --git a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/CartVO.java b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/CartVO.java index e620b3ed1..92d9b679e 100644 --- a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/CartVO.java +++ b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/CartVO.java @@ -32,7 +32,7 @@ public class CartVO implements Serializable { private Long coupon; - private boolean checked; + private Boolean checked; private Integer stock;// 商品库存数量,页面控制能选择最大数量 diff --git a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/OrderConfirmVO.java b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/OrderConfirmVO.java index ebbeb6704..f1405bb81 100644 --- a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/OrderConfirmVO.java +++ b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/OrderConfirmVO.java @@ -1,6 +1,7 @@ package com.youlai.mall.oms.pojo.vo; import com.youlai.common.base.BaseVO; +import com.youlai.mall.oms.pojo.dto.OrderItemDTO; import com.youlai.mall.ums.pojo.domain.UmsAddress; import lombok.Data; @@ -12,7 +13,7 @@ public class OrderConfirmVO extends BaseVO { private String orderToken; - private List orderItems; + private List orderItems; private List addresses; diff --git a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/OrderItemVO.java b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/OrderItemVO.java deleted file mode 100644 index c8dad4db2..000000000 --- a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/OrderItemVO.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.youlai.mall.oms.pojo.vo; - -import com.youlai.common.base.BaseVO; -import lombok.Builder; -import lombok.Data; -import lombok.Getter; -import lombok.Setter; - -/** - * 订单商品 - */ -@Builder -@Data -public class OrderItemVO extends BaseVO { - - private Long skuId; - private Integer count; - private String skuPic; - private String title; - private Long price; -} diff --git a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/OrderSubmitVO.java b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/OrderSubmitVO.java index 0cf8f4a3a..7338d1d5a 100644 --- a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/OrderSubmitVO.java +++ b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/OrderSubmitVO.java @@ -14,10 +14,11 @@ public class OrderSubmitVO extends BaseVO { /** * 订单ID */ - private Long id; + private Long orderId; /** - * 订单号 + * 订单编号,进入支付页面显示 */ private String orderSn; + } diff --git a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/PayVO.java b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/PayVO.java deleted file mode 100644 index c3142380d..000000000 --- a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/pojo/vo/PayVO.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.youlai.mall.oms.pojo.vo; - -import com.youlai.common.base.BaseVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @author huawei - * @desc 支付订单详情模型 - * @email huawei_code@163.com - * @date 2021/2/21 - */ -@ApiModel("支付订单详情模型") -@Data -public class PayVO extends BaseVO { - - /** - * 支付金额 - */ - @ApiModelProperty("支付金额") - private Long payAmount; - - /** - * 会员余额 - */ - @ApiModelProperty("会员余额") - private Long balance; -} diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/constant/OmsConstants.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/constant/OmsConstants.java index d195becd5..d44e75d93 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/constant/OmsConstants.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/constant/OmsConstants.java @@ -6,9 +6,9 @@ package com.youlai.mall.oms.constant; */ public interface OmsConstants { - String CART_PREFIX = "mall:cart:"; + String CART_PREFIX = "cart:"; - String ORDER_TOKEN_PREFIX = "mall:order:token:"; + String ORDER_TOKEN_PREFIX = "order:token:"; String BUSINESS_NO_PREFIX = "businessno:"; diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/CartController.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/CartController.java index 04a6f0074..f069ac19a 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/CartController.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/CartController.java @@ -25,14 +25,14 @@ public class CartController { private ICartService cartService; - @ApiOperation(value = "查询购物车", httpMethod = "GET") + @ApiOperation(value = "查询购物车") @GetMapping public Result getCart() { CartVO cart = cartService.getCart(); return Result.success(cart); } - @ApiOperation(value = "全选/全不选 购物车商品", httpMethod = "PUT") + @ApiOperation(value = "全选/全不选 购物车商品") @ApiImplicitParam(name = "checked", value = "全选/全不选", required = true, paramType = "param", dataType = "Boolean") @PatchMapping("/_check") public Result check(boolean checked) { @@ -40,7 +40,7 @@ public class CartController { return Result.judge(result); } - @ApiOperation(value = "清空购物车", httpMethod = "DELETE") + @ApiOperation(value = "清空购物车") @DeleteMapping public Result deleteCart() { boolean result = cartService.deleteCart(); @@ -48,7 +48,7 @@ public class CartController { } - @ApiOperation(value = "添加购物车商品", httpMethod = "POST") + @ApiOperation(value = "添加购物车商品") @ApiImplicitParam(name = "skuId", value = "SKU ID", required = true, paramType = "param", dataType = "Long") @PostMapping public Result addCartItem(@RequestParam Long skuId) { @@ -56,15 +56,16 @@ public class CartController { return Result.success(); } - @ApiOperation(value = "更新购物车商品", httpMethod = "PUT") + @ApiOperation(value = "更新购物车商品") @PutMapping("/skuId/{skuId}") - public Result updateCartItem(@RequestBody CartVO.CartItem cartItem) { + public Result updateCartItem(@PathVariable Long skuId,@RequestBody CartVO.CartItem cartItem) { + cartItem.setSkuId(skuId); boolean result = cartService.updateCartItem(cartItem); return Result.judge(result); } - @ApiOperation(value = "删除购物车商品", httpMethod = "DELETE") + @ApiOperation(value = "删除购物车商品") @ApiImplicitParam(name = "skuId", value = "SKU ID", required = true, paramType = "param", dataType = "Long") @DeleteMapping("/skuId/{skuId}") public Result removeCartItem(@PathVariable Long skuId) { 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 bdcf66c2e..608324c68 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 @@ -1,11 +1,13 @@ package com.youlai.mall.oms.controller.app; import com.youlai.common.result.Result; +import com.youlai.mall.oms.enums.PayTypeEnum; import com.youlai.mall.oms.pojo.dto.OrderConfirmDTO; import com.youlai.mall.oms.pojo.vo.OrderConfirmVO; import com.youlai.mall.oms.pojo.vo.OrderListVO; import com.youlai.mall.oms.pojo.vo.OrderSubmitVO; import com.youlai.mall.oms.pojo.dto.OrderSubmitDTO; +import com.youlai.mall.oms.service.IOrderPayService; import com.youlai.mall.oms.service.IOrderService; import io.swagger.annotations.*; import lombok.AllArgsConstructor; @@ -30,7 +32,9 @@ public class OrderController { private IOrderService orderService; - @ApiOperation(value = "确认订单", httpMethod = "POST") + private IOrderPayService orderPayService; + + @ApiOperation( "订单确认") @ApiImplicitParam(name = "orderConfirm",value = "确认订单信息",required = true, paramType = "body", dataType = "OrderConfirmDTO") @PostMapping("/_confirm") public Result confirm(@RequestBody OrderConfirmDTO orderConfirm) { @@ -38,7 +42,7 @@ public class OrderController { return Result.success(result); } - @ApiOperation(value = "提交订单", httpMethod = "POST") + @ApiOperation( "订单提交") @ApiImplicitParam(name = "orderSubmitDTO", value = "提交订单信息", required = true, paramType = "body", dataType = "orderSubmitDTO") @PostMapping("/_submit") public Result submit(@Valid @RequestBody OrderSubmitDTO orderSubmitDTO) { @@ -46,6 +50,25 @@ public class OrderController { return Result.success(result); } + @ApiOperation("订单支付") + @PostMapping("/{orderId}/_pay") + @ApiImplicitParams({ + @ApiImplicitParam(name = "orderId", value = "订单ID", paramType = "path", dataType = "Long"), + @ApiImplicitParam(name = "payType", value = "支付方式", paramType = "query", dataType = "Integer") + }) + public Result pay(@PathVariable Long orderId, Integer payType) { + PayTypeEnum payTypeEnum = PayTypeEnum.getValue(payType); + + switch (payTypeEnum) { + case BALANCE: + orderPayService.pay(orderId); + break; + default: + return Result.failed("系统暂不支持该支付方式~"); + } + return Result.success(); + } + @ApiOperation("订单列表") @GetMapping public Result> list( @@ -54,5 +77,4 @@ public class OrderController { List orderList = orderService.list(status); return Result.success(orderList); } - } diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/PayController.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/PayController.java deleted file mode 100644 index be2ccf7c0..000000000 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/controller/app/PayController.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.youlai.mall.oms.controller.app; - - -import com.youlai.common.result.Result; -import com.youlai.mall.oms.enums.PayTypeEnum; -import com.youlai.mall.oms.pojo.vo.PayVO; -import com.youlai.mall.oms.service.IOrderPayService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - - -/** - * @author huawei - * @email huawei_code@163.com - * @date 2020-12-30 22:31:10 - */ -@Api(tags = "【移动端】订单支付") -@RestController -@RequestMapping("/api.app/v1/payments") -@Slf4j -@AllArgsConstructor -public class PayController { - - private IOrderPayService orderPayService; - - /** - * 订单支付 - * 1、根据支付类型选择正确支付方式(1:微信支付;2:支付宝支付;3:余额支付) - * 2、根据订单ID查询订单价格,进行支付(在整个支付的过程中进行事务控制,保证整个操作的原子性) - * 3、将支付结果记录日志并返回给前端 - * - * @return - */ - @ApiOperation("订单支付") - @PostMapping - @ApiImplicitParams({ - @ApiImplicitParam(name = "orderId", value = "订单ID", paramType = "query", dataType = "Long"), - @ApiImplicitParam(name = "payType", value = "支付方式", paramType = "query", dataType = "Integer") - - }) - public Result pay( - Integer payType, - Long orderId - ) { - PayTypeEnum payTypeEnum = PayTypeEnum.getValue(payType); - - switch (payTypeEnum) { - case ALIPAY: - case WEIXIN: - // TODO - break; - case BALANCE: - orderPayService.pay(orderId); - break; - default: - return Result.failed("系统暂不支持该支付方式~"); - } - return Result.success(); - } - - @ApiOperation(value = "获取订单支付详情") - @GetMapping("/orderId/{orderId}") - public Result detail(@PathVariable Long orderId) { - PayVO payInfo = orderPayService.getByOrderId(orderId); - return Result.success(payInfo); - } -} diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/ICartService.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/ICartService.java index d8d3731e9..7d18161f7 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/ICartService.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/ICartService.java @@ -12,7 +12,7 @@ public interface ICartService { CartVO getCart(); - List getCartItems(); + List getCartItems(Long memberId); boolean deleteCart(); diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/IOrderPayService.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/IOrderPayService.java index 17c9a7d3c..a70678b2f 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/IOrderPayService.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/IOrderPayService.java @@ -3,7 +3,6 @@ package com.youlai.mall.oms.service; import com.baomidou.mybatisplus.extension.service.IService; import com.youlai.mall.oms.pojo.domain.OmsOrderPay; -import com.youlai.mall.oms.pojo.vo.PayVO; /** * 支付信息表 @@ -17,6 +16,5 @@ public interface IOrderPayService extends IService { boolean pay(Long orderId); - PayVO getByOrderId(Long orderId); } diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/CartServiceImpl.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/CartServiceImpl.java index af831bca9..262dadcdb 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/CartServiceImpl.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/CartServiceImpl.java @@ -22,9 +22,9 @@ import java.util.concurrent.CompletableFuture; * 技术点:BoundHashOperations * 数据格式: * -- key <----> 购物车 - * -- hKey:value <----> 购物车商品1 - * -- hKey:value <----> 购物车商品2 - * -- hKey:value <----> 购物车商品3 + * -- hKey:value <----> 商品1 + * -- hKey:value <----> 商品2 + * -- hKey:value <----> 商品3 */ @Service @Slf4j @@ -40,15 +40,16 @@ public class CartServiceImpl implements ICartService { @Override public CartVO getCart() { CartVO cart = new CartVO(); - BoundHashOperations cartHashOperations = getCartHashOperations(); + Long memberId=RequestUtils.getUserId(); + BoundHashOperations cartHashOperations = getCartHashOperations(memberId); List cartItems = cartHashOperations.values(); cart.setItems(cartItems); return cart; } @Override - public List getCartItems() { - BoundHashOperations cartHashOperations = getCartHashOperations(); + public List getCartItems(Long memberId) { + BoundHashOperations cartHashOperations = getCartHashOperations(memberId); List cartItems = cartHashOperations.values(); return cartItems; } @@ -69,7 +70,8 @@ public class CartServiceImpl implements ICartService { */ @Override public boolean addCartItem(Long skuId) { - BoundHashOperations cartHashOperations = getCartHashOperations(); + Long memberId=RequestUtils.getUserId(); + BoundHashOperations cartHashOperations = getCartHashOperations(memberId); String hKey = skuId + ""; CartVO.CartItem cartItem; @@ -106,14 +108,18 @@ public class CartServiceImpl implements ICartService { */ @Override public boolean updateCartItem(CartVO.CartItem cartItem) { - BoundHashOperations cartHashOperations = getCartHashOperations(); + Long memberId=RequestUtils.getUserId(); + BoundHashOperations cartHashOperations = getCartHashOperations(memberId); String hKey = cartItem.getSkuId() + ""; if (cartHashOperations.get(hKey) != null) { - CartVO.CartItem cacheCartItem = (CartVO.CartItem) cartHashOperations.get(hKey); - - - cartHashOperations.put(hKey, cartItem); + if(cartItem.getChecked()!=null){ + cacheCartItem.setChecked(cartItem.getChecked()); + } + if(cartItem.getCount()!=null){ + cacheCartItem.setCount(cartItem.getCount()); + } + cartHashOperations.put(hKey, cacheCartItem); } return true; } @@ -123,7 +129,8 @@ public class CartServiceImpl implements ICartService { */ @Override public boolean removeCartItem(Long skuId) { - BoundHashOperations cartHashOperations = getCartHashOperations(); + Long memberId=RequestUtils.getUserId(); + BoundHashOperations cartHashOperations = getCartHashOperations(memberId); String hKey = skuId + ""; cartHashOperations.delete(hKey); return true; @@ -135,7 +142,8 @@ public class CartServiceImpl implements ICartService { */ @Override public boolean checkAll(boolean checked) { - BoundHashOperations cartHashOperations = getCartHashOperations(); + Long memberId=RequestUtils.getUserId(); + BoundHashOperations cartHashOperations = getCartHashOperations(memberId); for (Object value : cartHashOperations.values()) { CartVO.CartItem cartItem = (CartVO.CartItem) value; cartItem.setChecked(checked); @@ -152,10 +160,11 @@ public class CartServiceImpl implements ICartService { */ @Override public boolean removeCheckedItem() { - BoundHashOperations cartHashOperations = getCartHashOperations(); + Long memberId=RequestUtils.getUserId(); + BoundHashOperations cartHashOperations = getCartHashOperations(memberId); for (Object value : cartHashOperations.values()) { CartVO.CartItem cartItem = (CartVO.CartItem) value; - if (cartItem.isChecked()) { + if (cartItem.getChecked()) { cartHashOperations.delete(cartItem.getSkuId()+""); } } @@ -165,9 +174,8 @@ public class CartServiceImpl implements ICartService { /** * 获取第一层,即某个用户的购物车 */ - private BoundHashOperations getCartHashOperations() { - Long userId = RequestUtils.getUserId(); - String cartKey = OmsConstants.CART_PREFIX + userId; + private BoundHashOperations getCartHashOperations(Long memberId) { + String cartKey = OmsConstants.CART_PREFIX + memberId; BoundHashOperations operations = redisTemplate.boundHashOps(cartKey); return operations; } diff --git a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/OrderPayServiceImpl.java b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/OrderPayServiceImpl.java index 3d47391a8..eb22c34db 100644 --- a/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/OrderPayServiceImpl.java +++ b/mall-oms/oms-boot/src/main/java/com/youlai/mall/oms/service/impl/OrderPayServiceImpl.java @@ -9,7 +9,7 @@ import com.youlai.mall.oms.enums.PayTypeEnum; import com.youlai.mall.oms.mapper.OrderPayMapper; import com.youlai.mall.oms.pojo.domain.OmsOrder; import com.youlai.mall.oms.pojo.domain.OmsOrderPay; -import com.youlai.mall.oms.pojo.vo.PayVO; +import com.youlai.mall.oms.service.ICartService; import com.youlai.mall.oms.service.IOrderPayService; import com.youlai.mall.oms.service.IOrderService; import com.youlai.mall.pms.api.app.PmsSkuFeignService; @@ -30,6 +30,7 @@ public class OrderPayServiceImpl extends ServiceImpl impleme private PmsSkuFeignService skuFeignService; private UmsAddressFeignService addressFeignService; private IOrderItemService orderItemService; - private IOrderLogService orderLogService; private RabbitTemplate rabbitTemplate; private StringRedisTemplate redisTemplate; private ThreadPoolExecutor threadPoolExecutor; @@ -66,29 +65,30 @@ public class OrderServiceImpl extends ServiceImpl impleme @Override public OrderConfirmVO confirm(OrderConfirmDTO orderConfirmDTO) { OrderConfirmVO orderConfirmVO = new OrderConfirmVO(); + Long memberId = RequestUtils.getUserId(); // 获取购买商品信息 CompletableFuture orderItemsCompletableFuture = CompletableFuture.runAsync(() -> { - List orderItems = new ArrayList<>(); + List orderItems = new ArrayList<>(); if (orderConfirmDTO.getSkuId() != null) { // 直接购买商品结算 - OrderItemVO orderItemVO = OrderItemVO.builder() + OrderItemDTO orderItemDTO = OrderItemDTO.builder() .skuId(orderConfirmDTO.getSkuId()) .count(orderConfirmDTO.getCount()) .build(); PmsSku sku = skuFeignService.getSkuById(orderConfirmDTO.getSkuId()).getData(); - orderItemVO.setPrice(sku.getPrice()); - orderItemVO.setSkuPic(sku.getPic()); - orderItemVO.setTitle(sku.getTitle()); - orderItems.add(orderItemVO); + orderItemDTO.setPrice(sku.getPrice()); + orderItemDTO.setPic(sku.getPic()); + orderItemDTO.setTitle(sku.getTitle()); + orderItems.add(orderItemDTO); } else { // 购物车中商品结算 - List cartItems = cartService.getCartItems(); - List items = cartItems.stream() - .filter(CartVO.CartItem::isChecked) - .map(cartItem -> OrderItemVO.builder() + List cartItems = cartService.getCartItems(memberId); + List items = cartItems.stream() + .filter(CartVO.CartItem::getChecked) + .map(cartItem -> OrderItemDTO.builder() .skuId(cartItem.getSkuId()) .count(cartItem.getCount()) .price(cartItem.getPrice()) .title(cartItem.getTitle()) - .skuPic(cartItem.getPic()) + .pic(cartItem.getPic()) .build()) .collect(Collectors.toList()); orderItems.addAll(items); @@ -98,7 +98,7 @@ public class OrderServiceImpl extends ServiceImpl impleme // 获取会员地址列表 CompletableFuture addressesCompletableFuture = CompletableFuture.runAsync(() -> { - List addresses = addressFeignService.list().getData(); + List addresses = addressFeignService.list(memberId).getData(); orderConfirmVO.setAddresses(addresses); }, threadPoolExecutor); @@ -110,7 +110,7 @@ public class OrderServiceImpl extends ServiceImpl impleme redisTemplate.opsForValue().set(ORDER_TOKEN_PREFIX + orderToken, orderToken); }, threadPoolExecutor); - CompletableFuture.allOf(orderItemsCompletableFuture, addressesCompletableFuture, orderTokenCompletableFuture); + CompletableFuture.allOf(orderItemsCompletableFuture, addressesCompletableFuture, orderTokenCompletableFuture).join(); return orderConfirmVO; } @@ -126,11 +126,11 @@ public class OrderServiceImpl extends ServiceImpl impleme DefaultRedisScript redisScript = new DefaultRedisScript<>(RELEASE_LOCK_LUA_SCRIPT, Long.class); Long result = this.redisTemplate.execute(redisScript, Collections.singletonList(ORDER_TOKEN_PREFIX + orderToken), orderToken); - if (ObjectUtil.equals(result, RELEASE_LOCK_SUCCESS_RESULT)) { + if (!ObjectUtil.equals(result, RELEASE_LOCK_SUCCESS_RESULT)) { throw new BizException("订单不可重复提交"); } - List orderItems = submitDTO.getOrderItems(); + List orderItems = submitDTO.getOrderItems(); if (CollectionUtil.isEmpty(orderItems)) { throw new BizException("请选择商品再提交"); } @@ -168,7 +168,8 @@ public class OrderServiceImpl extends ServiceImpl impleme .setStatus(OrderStatusEnum.PENDING_PAYMENT.getCode()) .setSourceType(OrderTypeEnum.APP.getCode()) .setMemberId(RequestUtils.getUserId()) - .setRemark(submitDTO.getRemark()); + .setRemark(submitDTO.getRemark()) + .setPayAmount(submitDTO.getPayAmount()); this.save(order); // 创建订单商品 @@ -176,7 +177,7 @@ public class OrderServiceImpl extends ServiceImpl impleme .orderId(order.getId()) .skuId(item.getSkuId()) .skuPrice(item.getPrice()) - .skuPic(item.getSkuPic()) + .skuPic(item.getPic()) .skuQuantity(item.getCount()) .build()).collect(Collectors.toList()); orderItemService.saveBatch(orderItemList); @@ -185,7 +186,7 @@ public class OrderServiceImpl extends ServiceImpl impleme rabbitTemplate.convertAndSend("order.exchange", "order.create", orderToken); OrderSubmitVO submitVO = new OrderSubmitVO(); - submitVO.setId(order.getId()); + submitVO.setOrderId(order.getId()); submitVO.setOrderSn(order.getOrderSn()); return submitVO; } diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/AttributeController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/AttributeController.java index 00413b64a..2f41746ad 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/AttributeController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/AttributeController.java @@ -25,7 +25,7 @@ public class AttributeController { private IPmsAttributeService iPmsAttributeService; - @ApiOperation(value = "属性列表", httpMethod = "GET") + @ApiOperation(value = "属性列表") @ApiImplicitParams({ @ApiImplicitParam(name = "categoryId", value = "商品分类ID", paramType = "query", dataType = "Long") }) @@ -36,7 +36,7 @@ public class AttributeController { return Result.success(list); } - @ApiOperation(value = "批量新增", httpMethod = "POST") + @ApiOperation(value = "批量新增") @ApiImplicitParam(name = "attributes", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsAttribute") @PostMapping("/batch") public Result saveBatch(@RequestBody List attributes) { diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/BrandController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/BrandController.java index 3abd7216b..5e7a585fd 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/BrandController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/BrandController.java @@ -30,7 +30,7 @@ public class BrandController { private IPmsBrandService iPmsBrandService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "queryMode", paramType = "query", dataType = "QueryModeEnum"), @ApiImplicitParam(name = "page", value = "页码", paramType = "query", dataType = "Long"), @@ -56,7 +56,7 @@ public class BrandController { } } - @ApiOperation(value = "品牌详情", httpMethod = "GET") + @ApiOperation(value = "品牌详情") @ApiImplicitParam(name = "id", value = "品牌id", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Integer id) { @@ -64,7 +64,7 @@ public class BrandController { return Result.success(brand); } - @ApiOperation(value = "新增品牌", httpMethod = "POST") + @ApiOperation(value = "新增品牌") @ApiImplicitParam(name = "brand", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsBrand") @PostMapping public Result add(@RequestBody PmsBrand brand) { @@ -72,7 +72,7 @@ public class BrandController { return Result.judge(status); } - @ApiOperation(value = "修改品牌", httpMethod = "PUT") + @ApiOperation(value = "修改品牌") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "品牌id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "brand", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsBrand") @@ -85,7 +85,7 @@ public class BrandController { return Result.judge(status); } - @ApiOperation(value = "删除品牌", httpMethod = "DELETE") + @ApiOperation(value = "删除品牌") @ApiImplicitParam(name = "ids", value = "id集合", required = true, dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable("ids") String ids) { @@ -93,7 +93,7 @@ public class BrandController { return Result.judge(status); } - @ApiOperation(value = "修改品牌", httpMethod = "PATCH") + @ApiOperation(value = "修改品牌") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "brand", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsBrand") diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/CategoryController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/CategoryController.java index 835217975..7dac868e7 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/CategoryController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/CategoryController.java @@ -33,7 +33,7 @@ public class CategoryController { private IPmsAttributeService iPmsAttributeService; private IPmsSpecService iPmsSpecService; - @ApiOperation(value = "分类列表", httpMethod = "GET") + @ApiOperation(value = "分类列表") @ApiImplicitParams({ @ApiImplicitParam(name = "queryMode", paramType = "query", dataType = "String"), }) @@ -52,7 +52,7 @@ public class CategoryController { } } - @ApiOperation(value = "分类详情", httpMethod = "GET") + @ApiOperation(value = "分类详情") @ApiImplicitParam(name = "id", value = "商品分类id", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Integer id) { @@ -60,7 +60,7 @@ public class CategoryController { return Result.success(category); } - @ApiOperation(value = "新增分类", httpMethod = "POST") + @ApiOperation(value = "新增分类") @ApiImplicitParam(name = "category", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsCategory") @PostMapping public Result add(@RequestBody PmsCategory category) { @@ -70,7 +70,7 @@ public class CategoryController { return Result.success(categoryVO); } - @ApiOperation(value = "修改分类", httpMethod = "PUT") + @ApiOperation(value = "修改分类") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "商品分类id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "category", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsCategory") @@ -83,7 +83,7 @@ public class CategoryController { return Result.success(category); } - @ApiOperation(value = "删除商品分类", httpMethod = "DELETE") + @ApiOperation(value = "删除商品分类") @ApiImplicitParam(name = "ids", value = "id集合,以英文逗号','分隔", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable String ids) { @@ -98,7 +98,7 @@ public class CategoryController { return Result.success(); } - @ApiOperation(value = "修改分类", httpMethod = "PATCH") + @ApiOperation(value = "修改分类") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "category", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsCategory") diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SkuController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SkuController.java index 1ce5a565c..6f7537197 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SkuController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SkuController.java @@ -22,7 +22,7 @@ public class SkuController { private IPmsSkuService iPmsSkuService; - @ApiOperation(value = "商品详情", httpMethod = "GET") + @ApiOperation(value = "商品详情") @ApiImplicitParam(name = "id", value = "商品SkuID", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Long id) { @@ -30,7 +30,7 @@ public class SkuController { return Result.success(sku); } - @ApiOperation(value = "修改库存", httpMethod = "PUT") + @ApiOperation(value = "修改库存") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "商品id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "sku", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsSku") @@ -44,7 +44,7 @@ public class SkuController { } - @ApiOperation(value = "修改库存", httpMethod = "PUT") + @ApiOperation(value = "修改库存") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "Sku ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "num", value = "库存数量", required = true, paramType = "query", dataType = "Long") diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SpecController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SpecController.java index 397327113..9d68839b3 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SpecController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SpecController.java @@ -25,7 +25,7 @@ public class SpecController { private IPmsSpecService iPmsSpecService; - @ApiOperation(value = "分类规格列表", httpMethod = "GET") + @ApiOperation(value = "分类规格列表") @ApiImplicitParams({ @ApiImplicitParam(name = "categoryId", value = "分类ID", paramType = "query", dataType = "Long") }) @@ -37,7 +37,7 @@ public class SpecController { return Result.success(list); } - @ApiOperation(value = "新增规格", httpMethod = "POST") + @ApiOperation(value = "新增规格") @ApiImplicitParam(name = "specCategories", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsSpecCategory") @PostMapping public Result save(@RequestBody List specCategories) { diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SpuController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SpuController.java index f1a38cd41..3457ab841 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SpuController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/SpuController.java @@ -29,7 +29,7 @@ public class SpuController { private IPmsSpuService iPmsSpuService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "queryMode", value = "查询模式", paramType = "query", dataType = "QueryModeEnum"), @ApiImplicitParam(name = "page", value = "页码", paramType = "query", dataType = "Long"), @@ -58,7 +58,7 @@ public class SpuController { } } - @ApiOperation(value = "商品详情", httpMethod = "GET") + @ApiOperation(value = "商品详情") @ApiImplicitParam(name = "id", value = "商品id", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Long id) { @@ -67,7 +67,7 @@ public class SpuController { } - @ApiOperation(value = "新增商品", httpMethod = "POST") + @ApiOperation(value = "新增商品") @ApiImplicitParam(name = "spuBO", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsSpuBO") @PostMapping public Result add(@RequestBody ProductBO spuBO) { @@ -75,7 +75,7 @@ public class SpuController { return Result.judge(status); } - @ApiOperation(value = "修改商品", httpMethod = "PUT") + @ApiOperation(value = "修改商品") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "商品id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "spu", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsSpu") @@ -88,7 +88,7 @@ public class SpuController { return Result.judge(status); } - @ApiOperation(value = "删除商品", httpMethod = "DELETE") + @ApiOperation(value = "删除商品") @ApiImplicitParam(name = "ids", value = "id集合,以英文逗号','分隔", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable String ids) { @@ -96,7 +96,7 @@ public class SpuController { return Result.success(); } - @ApiOperation(value = "修改商品", httpMethod = "PATCH") + @ApiOperation(value = "修改商品") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "spu", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsSpu") diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/CategoryController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/CategoryController.java index b8874d4c9..55c226878 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/CategoryController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/CategoryController.java @@ -26,7 +26,7 @@ public class CategoryController { private IPmsCategoryService iPmsCategoryService; - @ApiOperation(value = "分类列表", httpMethod = "GET") + @ApiOperation(value = "分类列表") @ApiImplicitParams({ @ApiImplicitParam(name = "parentId", paramType = "query", dataType = "Long") }) diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/ProductController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/ProductController.java index 9c0301325..329a33e7f 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/ProductController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/ProductController.java @@ -30,7 +30,7 @@ public class ProductController { private IProductService iProductService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "page", value = "页码", defaultValue = "1", paramType = "query", dataType = "Long"), @ApiImplicitParam(name = "limit", value = "每页数量", defaultValue = "10", paramType = "query", dataType = "Long"), @@ -60,7 +60,7 @@ public class ProductController { return Result.success(list, result.getTotal()); } - @ApiOperation(value = "商品详情", httpMethod = "GET") + @ApiOperation(value = "商品详情") @ApiImplicitParam(name = "id", value = "商品ID", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Long id) { diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/SearchController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/SearchController.java index 0ded05a40..897a9342b 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/SearchController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/SearchController.java @@ -23,7 +23,7 @@ public class SearchController { private ElasticSearchService elasticSearchService; - @ApiOperation(value = "关键字搜索商品", httpMethod = "GET") + @ApiOperation(value = "关键字搜索商品") @ApiImplicitParams({ @ApiImplicitParam(name = "key", value = "关键字", paramType = "query", dataType = "String"), }) diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/SkuController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/SkuController.java index be4df1789..bbd064cba 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/SkuController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/app/SkuController.java @@ -21,7 +21,7 @@ public class SkuController { private IPmsSkuService iPmsSkuService; - @ApiOperation(value = "商品详情", httpMethod = "GET") + @ApiOperation(value = "商品详情") @ApiImplicitParam(name = "id", value = "商品ID", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Long id) { @@ -38,7 +38,7 @@ public class SkuController { } - @ApiOperation(value = "锁定库存", httpMethod = "PUT") + @ApiOperation(value = "锁定库存") @ApiImplicitParam(name = "list", value = "商品列表", required = true, paramType = "body", dataType = "SkuLockDTO") @PutMapping("/lock_stock") public Result lockStock(@RequestBody List list) { @@ -47,7 +47,7 @@ public class SkuController { } - @ApiOperation(value = "解锁库存", httpMethod = "PUT") + @ApiOperation(value = "解锁库存") @ApiImplicitParam(name = "orderToken", value = "订单令牌", required = true, paramType = "body", dataType = "String") @PutMapping("/unlock_stock") public Result unlockStock(String orderToken) { @@ -55,7 +55,7 @@ public class SkuController { return Result.judge(result); } - @ApiOperation(value = "扣减库存", httpMethod = "PUT") + @ApiOperation(value = "扣减库存") @ApiImplicitParam(name = "orderToken", value = "订单令牌", required = true, paramType = "body", dataType = "String") @PutMapping("/deduct_stock") public Result deductStock(String orderToken) { @@ -63,7 +63,7 @@ public class SkuController { return Result.judge(result); } - @ApiOperation(value = "商品列表", httpMethod = "GET") + @ApiOperation(value = "商品列表") @ApiImplicitParam(name = "skuIds", value = "商品ID集合", required = true, paramType = "body", dataType = "String") @GetMapping public Result list(@RequestParam List ids) { diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/service/impl/PmsSkuServiceImpl.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/service/impl/PmsSkuServiceImpl.java index 7fb1a8d66..531a43c6c 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/service/impl/PmsSkuServiceImpl.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/service/impl/PmsSkuServiceImpl.java @@ -42,7 +42,7 @@ public class PmsSkuServiceImpl extends ServiceImpl impleme @Override public boolean lockStock(List skuLockList) { - if (CollectionUtil.isNotEmpty(skuLockList)) { + if (CollectionUtil.isEmpty(skuLockList)) { throw new BizException("锁定的商品列表为空"); } @@ -113,7 +113,7 @@ public class PmsSkuServiceImpl extends ServiceImpl impleme @Override public boolean deductStock(String orderToken) { String json = redisTemplate.opsForValue().get(STOCK_LOCKED_PREFIX + orderToken); - if (StrUtil.isNotBlank(json)) { + if (StrUtil.isBlank(json)) { return true; } diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/AdvertController.java b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/AdvertController.java index 014c2003e..12d3e8c4d 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/AdvertController.java +++ b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/AdvertController.java @@ -29,7 +29,7 @@ public class AdvertController { private ISmsAdvertService iSmsAdvertService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "queryMode", value = "查询模式", paramType = "query", dataType = "QueryModeEnum"), @ApiImplicitParam(name = "page", value = "页码", paramType = "query", dataType = "Long"), @@ -56,7 +56,7 @@ public class AdvertController { } } - @ApiOperation(value = "广告详情", httpMethod = "GET") + @ApiOperation(value = "广告详情") @ApiImplicitParam(name = "id", value = "广告id", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Integer id) { @@ -64,7 +64,7 @@ public class AdvertController { return Result.success(advert); } - @ApiOperation(value = "新增广告", httpMethod = "POST") + @ApiOperation(value = "新增广告") @ApiImplicitParam(name = "advert", value = "实体JSON对象", required = true, paramType = "body", dataType = "SmsAdvert") @PostMapping public Result add(@RequestBody SmsAdvert advert) { @@ -72,7 +72,7 @@ public class AdvertController { return Result.judge(status); } - @ApiOperation(value = "修改广告", httpMethod = "PUT") + @ApiOperation(value = "修改广告") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "广告id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "advert", value = "实体JSON对象", required = true, paramType = "body", dataType = "SmsAdvert") @@ -86,7 +86,7 @@ public class AdvertController { return Result.judge(status); } - @ApiOperation(value = "删除广告", httpMethod = "DELETE") + @ApiOperation(value = "删除广告") @ApiImplicitParam(name = "ids", value = "id集合", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable("ids") String ids) { @@ -94,7 +94,7 @@ public class AdvertController { return Result.judge(status); } - @ApiOperation(value = "修改广告(局部更新)", httpMethod = "PATCH") + @ApiOperation(value = "修改广告(局部更新)") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "advert", value = "实体JSON对象", required = true, paramType = "body", dataType = "SmsAdvert") diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java index f79ec2b61..e05e7d599 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java +++ b/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java @@ -23,7 +23,7 @@ public class AdvertController { private ISmsAdvertService iSmsAdvertService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @GetMapping public Result list() { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() diff --git a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/api/UmsAddressFeignService.java b/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/api/UmsAddressFeignService.java index e41a346bc..2e969a78c 100644 --- a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/api/UmsAddressFeignService.java +++ b/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/api/UmsAddressFeignService.java @@ -5,6 +5,7 @@ import com.youlai.mall.ums.pojo.domain.UmsAddress; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @@ -19,7 +20,7 @@ public interface UmsAddressFeignService { @GetMapping("/api.app/v1/addresses") - Result> list(); + Result> list(@RequestParam Long memberId); } diff --git a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/pojo/domain/UmsAddress.java b/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/pojo/domain/UmsAddress.java index 412d9985a..239e3ac89 100644 --- a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/pojo/domain/UmsAddress.java +++ b/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/pojo/domain/UmsAddress.java @@ -1,13 +1,11 @@ package com.youlai.mall.ums.pojo.domain; - import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.youlai.common.base.BaseEntity; import lombok.Data; import lombok.experimental.Accessors; - @Data @Accessors(chain = true) public class UmsAddress extends BaseEntity { @@ -15,7 +13,7 @@ public class UmsAddress extends BaseEntity { @TableId(type = IdType.AUTO) private Long id; - private Long userId; + private Long memberId; private String name; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/admin/MemberController.java b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/admin/MemberController.java index 782adb6ac..7f84bc691 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/admin/MemberController.java +++ b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/admin/MemberController.java @@ -29,7 +29,7 @@ public class MemberController { private IUmsUserService iUmsUserService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "queryMode", paramType = "query", dataType = "QueryModeEnum"), @ApiImplicitParam(name = "page", value = "页码", paramType = "query", dataType = "Long"), @@ -54,7 +54,7 @@ public class MemberController { } } - @ApiOperation(value = "会员详情", httpMethod = "GET") + @ApiOperation(value = "会员详情") @ApiImplicitParam(name = "id", value = "会员ID", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result getMemberById( @@ -64,7 +64,7 @@ public class MemberController { return Result.success(user); } - @ApiOperation(value = "修改会员", httpMethod = "PUT") + @ApiOperation(value = "修改会员") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "资源id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "member", value = "实体JSON对象", required = true, paramType = "body", dataType = "UmsMember") @@ -77,7 +77,7 @@ public class MemberController { return Result.judge(status); } - @ApiOperation(value = "局部更新", httpMethod = "PATCH") + @ApiOperation(value = "局部更新") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "member", value = "实体JSON对象", required = true, paramType = "body", dataType = "UmsMember") @@ -90,7 +90,7 @@ public class MemberController { return Result.judge(status); } - @ApiOperation(value = "删除会员", httpMethod = "DELETE") + @ApiOperation(value = "删除会员") @ApiImplicitParam(name = "ids", value = "id集合", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable String ids) { diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/admin/RechargeController.java b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/admin/RechargeController.java index 2f3f45e73..4a9114328 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/admin/RechargeController.java +++ b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/admin/RechargeController.java @@ -48,7 +48,7 @@ public class RechargeController { private String appSecret; - @ApiOperation(value = "账户余额充值订单", httpMethod = "POST") + @ApiOperation(value = "账户余额充值订单") @PostMapping public Result recharge(@RequestBody RechargeDTO rechargeDTO) { HttpHeaders headers = new HttpHeaders(); diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AddressController.java b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AddressController.java index 85facb490..1415bd795 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AddressController.java +++ b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AddressController.java @@ -28,26 +28,25 @@ public class AddressController { private final Integer ADDRESS_DEFAULTED = 1; - @ApiOperation(value = "获取当前登录会员的地址列表", httpMethod = "GET") + @ApiOperation(value = "获取会员的地址列表") @GetMapping - public Result list() { - Long userId = RequestUtils.getUserId(); + public Result list(@RequestParam Long memberId) { List addressList = iUmsAddressService.list(new LambdaQueryWrapper() - .eq(UmsAddress::getUserId, userId) + .eq(UmsAddress::getMemberId, memberId) .orderByDesc(UmsAddress::getDefaulted)); return Result.success(addressList); } - @ApiOperation(value = "新增地址", httpMethod = "POST") + @ApiOperation(value = "新增地址") @ApiImplicitParam(name = "address", value = "实体JSON对象", required = true, paramType = "body", dataType = "UmsAddress") @PostMapping public Result add(@RequestBody UmsAddress address) { Long userId = RequestUtils.getUserId(); - address.setUserId(userId); + address.setMemberId(userId); if (ADDRESS_DEFAULTED.equals(address.getDefaulted())) { // 修改其他默认地址为非默认 iUmsAddressService.update(new LambdaUpdateWrapper() - .eq(UmsAddress::getUserId, userId) + .eq(UmsAddress::getMemberId, userId) .eq(UmsAddress::getDefaulted, 1) .set(UmsAddress::getDefaulted, 0) ); @@ -57,7 +56,7 @@ public class AddressController { } - @ApiOperation(value = "修改地址", httpMethod = "PUT") + @ApiOperation(value = "修改地址") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "部门id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "address", value = "实体JSON对象", required = true, paramType = "body", dataType = "UmsAddress") @@ -69,7 +68,7 @@ public class AddressController { Long userId = RequestUtils.getUserId(); if (address.getDefaulted().equals(1)) { // 修改其他默认地址为非默认 iUmsAddressService.update(new LambdaUpdateWrapper() - .eq(UmsAddress::getUserId, userId) + .eq(UmsAddress::getMemberId, userId) .eq(UmsAddress::getDefaulted, 1) .set(UmsAddress::getDefaulted, 0) ); @@ -78,7 +77,7 @@ public class AddressController { return Result.judge(status); } - @ApiOperation(value = "删除地址", httpMethod = "DELETE") + @ApiOperation(value = "删除地址") @ApiImplicitParam(name = "ids", value = "id集合字符串,英文逗号分隔", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable String ids) { @@ -87,7 +86,7 @@ public class AddressController { } - @ApiOperation(value = "修改地址【部分更新】", httpMethod = "PATCH") + @ApiOperation(value = "修改地址【部分更新】") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "address", value = "实体JSON对象", required = true, paramType = "body", dataType = "UmsAddress") @@ -96,13 +95,13 @@ public class AddressController { public Result patch(@PathVariable Long id, @RequestBody UmsAddress address) { Long userId = RequestUtils.getUserId(); LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() - .eq(UmsAddress::getUserId, userId); + .eq(UmsAddress::getMemberId, userId); if (address.getDefaulted() != null) { updateWrapper.set(UmsAddress::getDefaulted, address.getDefaulted()); if (address.getDefaulted().equals(1)) { // 修改其他默认地址为非默认 iUmsAddressService.update(new LambdaUpdateWrapper() - .eq(UmsAddress::getUserId, userId) + .eq(UmsAddress::getMemberId, userId) .eq(UmsAddress::getDefaulted, 1) .set(UmsAddress::getDefaulted, 0) ); @@ -112,7 +111,7 @@ public class AddressController { return Result.judge(status); } - @ApiOperation(value = "根据id查询收货地址详情", httpMethod = "GET") + @ApiOperation(value = "根据id查询收货地址详情") @ApiImplicitParam(name = "id", value = "地址 id", required = true, paramType = "path", dataType = "String") @GetMapping("/{id}") public Result getAddressById(@PathVariable("id") String id) { diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/MemberController.java b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/MemberController.java index dd5d7feaa..f21f2d95c 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/MemberController.java +++ b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/MemberController.java @@ -27,7 +27,7 @@ public class MemberController { private IUmsUserService iUmsUserService; - @ApiOperation(value = "获取会员信息", httpMethod = "GET") + @ApiOperation(value = "获取会员信息") @ApiImplicitParam(name = "id", value = "会员ID", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result getMemberById( @@ -45,7 +45,7 @@ public class MemberController { return Result.success(memberDTO); } - @ApiOperation(value = "根据openid获取会员信息", httpMethod = "GET") + @ApiOperation(value = "根据openid获取会员信息") @ApiImplicitParam(name = "openid", value = "微信身份唯一标识", required = true, paramType = "path", dataType = "String") @GetMapping("/openid/{openid}") public Result getMemberByOpenid( @@ -61,7 +61,7 @@ public class MemberController { return Result.success(authMemberDTO); } - @ApiOperation(value = "新增会员", httpMethod = "POST") + @ApiOperation(value = "新增会员") @ApiImplicitParam(name = "member", value = "实体JSON对象", required = true, paramType = "body", dataType = "UmsMember") @PostMapping public Result add(@RequestBody UmsMember user) { @@ -69,7 +69,7 @@ public class MemberController { return Result.judge(status); } - @ApiOperation(value = "获取当前请求的会员信息", httpMethod = "GET") + @ApiOperation(value = "获取当前请求的会员信息") @GetMapping("/me") public Result getMemberInfo() { Long userId = RequestUtils.getUserId(); @@ -83,7 +83,7 @@ public class MemberController { } - @ApiOperation(value = "修改会员积分", httpMethod = "POST") + @ApiOperation(value = "修改会员积分") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "会员ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "num", value = "积分数量", required = true, paramType = "query", dataType = "Integer") @@ -96,7 +96,7 @@ public class MemberController { return Result.judge(result); } - @ApiOperation(value = "修改会员余额", httpMethod = "POST") + @ApiOperation(value = "修改会员余额") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "会员ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "balance", value = "会员余额", required = true, paramType = "query", dataType = "Long") @@ -109,7 +109,7 @@ public class MemberController { return Result.judge(result); } - @ApiOperation(value = "获取会员余额", httpMethod = "GET") + @ApiOperation(value = "获取会员余额") @ApiImplicitParam(name = "id", value = "会员ID", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}/balance") public Result updateBalance(@PathVariable Long id) { diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DashboardController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DashboardController.java index bab561a90..999f38edc 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DashboardController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DashboardController.java @@ -40,7 +40,7 @@ public class DashboardController { ElasticSearchService elasticSearchService; - @ApiOperation(value = "控制台数据", httpMethod = "GET") + @ApiOperation(value = "控制台数据") @GetMapping public Result data() { Map data = new HashMap<>(); diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DeptController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DeptController.java index d51902bf7..f4427cd13 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DeptController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DeptController.java @@ -34,7 +34,7 @@ public class DeptController { @Autowired private ISysDeptService iSysDeptService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "name", value = "部门名称", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "status", value = "部门状态", paramType = "query", dataType = "Long"), @@ -67,7 +67,7 @@ public class DeptController { } } - @ApiOperation(value = "部门详情", httpMethod = "GET") + @ApiOperation(value = "部门详情") @ApiImplicitParam(name = "id", value = "部门id", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Integer id) { @@ -75,7 +75,7 @@ public class DeptController { return Result.success(sysDept); } - @ApiOperation(value = "新增部门", httpMethod = "POST") + @ApiOperation(value = "新增部门") @ApiImplicitParam(name = "sysDept", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysDept") @PostMapping public Result add(@RequestBody SysDept sysDept) { @@ -85,7 +85,7 @@ public class DeptController { return Result.judge(status); } - @ApiOperation(value = "修改部门", httpMethod = "PUT") + @ApiOperation(value = "修改部门") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "部门id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "sysDept", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysDept") @@ -101,7 +101,7 @@ public class DeptController { return Result.judge(status); } - @ApiOperation(value = "删除部门", httpMethod = "DELETE") + @ApiOperation(value = "删除部门") @ApiImplicitParam(name = "ids", value = "id集合", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable("ids") String ids) { diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictController.java index a7d239b0e..f304d96a6 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictController.java @@ -35,7 +35,7 @@ public class DictController { private ISysDictItemService iSysDictItemService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "queryMode", paramType = "query", dataType = "QueryModeEnum"), @ApiImplicitParam(name = "page", value = "页码", paramType = "query", dataType = "Integer"), @@ -65,7 +65,7 @@ public class DictController { } } - @ApiOperation(value = "字典详情", httpMethod = "GET") + @ApiOperation(value = "字典详情") @ApiImplicitParam(name = "id", value = "字典id", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Integer id) { @@ -73,7 +73,7 @@ public class DictController { return Result.success(dict); } - @ApiOperation(value = "新增字典", httpMethod = "POST") + @ApiOperation(value = "新增字典") @ApiImplicitParam(name = "dictItem", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysDictItem") @PostMapping public Result add(@RequestBody SysDict dict) { @@ -81,7 +81,7 @@ public class DictController { return Result.judge(status); } - @ApiOperation(value = "修改字典", httpMethod = "PUT") + @ApiOperation(value = "修改字典") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "字典id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "dictItem", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysDictItem") @@ -103,7 +103,7 @@ public class DictController { return Result.judge(status); } - @ApiOperation(value = "删除字典", httpMethod = "DELETE") + @ApiOperation(value = "删除字典") @ApiImplicitParam(name = "ids", value = "以,分割拼接字符串", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable String ids) { @@ -119,7 +119,7 @@ public class DictController { return Result.judge(status); } - @ApiOperation(value = "局部更新字典", httpMethod = "PATCH") + @ApiOperation(value = "局部更新字典") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "dictItem", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysDictItem") diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictItemController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictItemController.java index 0ab1103c7..541711393 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictItemController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictItemController.java @@ -31,7 +31,7 @@ public class DictItemController { private ISysDictItemService iSysDictItemService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "queryMode", paramType = "query", dataType = "QueryModeEnum"), @ApiImplicitParam(name = "page", defaultValue = "1", value = "页码", paramType = "query", dataType = "Integer"), @@ -66,7 +66,7 @@ public class DictItemController { } } - @ApiOperation(value = "字典项详情", httpMethod = "GET") + @ApiOperation(value = "字典项详情") @ApiImplicitParam(name = "id", value = "字典id", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Integer id) { @@ -74,7 +74,7 @@ public class DictItemController { return Result.success(dictItem); } - @ApiOperation(value = "新增字典项", httpMethod = "POST") + @ApiOperation(value = "新增字典项") @ApiImplicitParam(name = "dictItem", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysDictItem") @PostMapping public Result add(@RequestBody SysDictItem dictItem) { @@ -82,7 +82,7 @@ public class DictItemController { return Result.judge(status); } - @ApiOperation(value = "修改字典项", httpMethod = "PUT") + @ApiOperation(value = "修改字典项") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "字典id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "dictItem", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysDictItem") @@ -96,7 +96,7 @@ public class DictItemController { return Result.judge(status); } - @ApiOperation(value = "删除字典数据", httpMethod = "DELETE") + @ApiOperation(value = "删除字典数据") @ApiImplicitParam(name = "ids", value = "主键ID集合,以,分割拼接字符串", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable String ids) { @@ -105,7 +105,7 @@ public class DictItemController { } - @ApiOperation(value = "局部更新字典数据", httpMethod = "PATCH") + @ApiOperation(value = "局部更新字典数据") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "dictItem", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysDictItem") diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/LoginRecordController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/LoginRecordController.java index d55a917d7..6ef1b9b0b 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/LoginRecordController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/LoginRecordController.java @@ -37,7 +37,7 @@ public class LoginRecordController { ITokenService tokenService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "page", value = "页码", defaultValue = "1", paramType = "query", dataType = "Long"), @ApiImplicitParam(name = "limit", value = "每页数量", defaultValue = "10", paramType = "query", dataType = "Long"), @@ -92,7 +92,7 @@ public class LoginRecordController { } - @ApiOperation(value = "删除登录记录", httpMethod = "DELETE") + @ApiOperation(value = "删除登录记录") @ApiImplicitParam(name = "ids", value = "id集合", required = true, paramType = "query", dataType = "String") @DeleteMapping public Result delete(@RequestBody List documents) { diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MenuController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MenuController.java index d354c975b..2784772c6 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MenuController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MenuController.java @@ -33,7 +33,7 @@ public class MenuController { private ISysMenuService iSysMenuService; private ISysRoleMenuService iSysRoleMenuService; - @ApiOperation(value = "菜单列表", httpMethod = "GET") + @ApiOperation(value = "菜单列表") @ApiImplicitParams({ @ApiImplicitParam(name = "name", value = "菜单名称", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "roleId", value = "角色ID", paramType = "query", dataType = "Long"), @@ -68,7 +68,7 @@ public class MenuController { return Result.success(list); } - @ApiOperation(value = "菜单详情", httpMethod = "GET") + @ApiOperation(value = "菜单详情") @ApiImplicitParam(name = "id", value = "菜单id", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Integer id) { @@ -76,7 +76,7 @@ public class MenuController { return Result.success(menu); } - @ApiOperation(value = "新增菜单", httpMethod = "POST") + @ApiOperation(value = "新增菜单") @ApiImplicitParam(name = "menu", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysMenu") @PostMapping public Result add(@RequestBody SysMenu menu) { @@ -84,7 +84,7 @@ public class MenuController { return Result.judge(status); } - @ApiOperation(value = "修改菜单", httpMethod = "PUT") + @ApiOperation(value = "修改菜单") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "菜单id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "menu", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysMenu") @@ -97,7 +97,7 @@ public class MenuController { return Result.judge(status); } - @ApiOperation(value = "删除菜单", httpMethod = "DELETE") + @ApiOperation(value = "删除菜单") @ApiImplicitParam(name = "ids", value = "id集合字符串,以,分割", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable("ids") String ids) { @@ -105,7 +105,7 @@ public class MenuController { return Result.judge(status); } - @ApiOperation(value = "修改菜单", httpMethod = "PATCH") + @ApiOperation(value = "修改菜单") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "menu", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysMenu") diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MinIOController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MinIOController.java index 16d5a36dd..589cb0528 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MinIOController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MinIOController.java @@ -25,7 +25,7 @@ public class MinIOController { private MinIOService minIOService; @PostMapping - @ApiOperation(value = "文件上传", httpMethod = "POST") + @ApiOperation(value = "文件上传") @ApiImplicitParams({ @ApiImplicitParam(name = "file", value = "文件", paramType = "form", dataType = "__file"), @ApiImplicitParam(name = "bucketName", value = "桶名称", paramType = "query", dataType = "string") @@ -45,7 +45,7 @@ public class MinIOController { } @DeleteMapping - @ApiOperation(value = "文件删除", httpMethod = "DELETE") + @ApiOperation(value = "文件删除") @ApiImplicitParams({ @ApiImplicitParam(name = "path", value = "文件路径", required = true, paramType = "query"), }) diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/OauthClientDetailsController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/OauthClientDetailsController.java index 2d9b52d72..bba57fc0e 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/OauthClientDetailsController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/OauthClientDetailsController.java @@ -27,7 +27,7 @@ public class OauthClientDetailsController { private IOauthClientDetailsService iOauthClientDetailsService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "page", value = "页码", paramType = "query", dataType = "Long"), @ApiImplicitParam(name = "limit", value = "每页数量", paramType = "query", dataType = "Long"), @@ -44,7 +44,7 @@ public class OauthClientDetailsController { return Result.success(result.getRecords(), result.getTotal()); } - @ApiOperation(value = "客户端详情", httpMethod = "GET") + @ApiOperation(value = "客户端详情") @ApiImplicitParam(name = "clientId", value = "客户端id", required = true, paramType = "path", dataType = "String") @GetMapping("/{clientId}") public Result detail(@PathVariable String clientId) { @@ -52,7 +52,7 @@ public class OauthClientDetailsController { return Result.success(client); } - @ApiOperation(value = "新增客户端", httpMethod = "POST") + @ApiOperation(value = "新增客户端") @ApiImplicitParam(name = "client", value = "实体JSON对象", required = true, paramType = "body", dataType = "OauthClientDetails") @PostMapping public Result add(@RequestBody OauthClientDetails client) { @@ -60,7 +60,7 @@ public class OauthClientDetailsController { return Result.judge(status); } - @ApiOperation(value = "修改客户端", httpMethod = "PUT") + @ApiOperation(value = "修改客户端") @ApiImplicitParams({ @ApiImplicitParam(name = "clientId", value = "客户端id", required = true, paramType = "path", dataType = "String"), @ApiImplicitParam(name = "client", value = "实体JSON对象", required = true, paramType = "body", dataType = "OauthClientDetails") @@ -73,7 +73,7 @@ public class OauthClientDetailsController { return Result.judge(status); } - @ApiOperation(value = "删除客户端", httpMethod = "DELETE") + @ApiOperation(value = "删除客户端") @ApiImplicitParam(name = "ids", value = "id集合,以,拼接字符串", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable("ids") String ids) { diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/PermissionController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/PermissionController.java index 31558fa4e..735cb548b 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/PermissionController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/PermissionController.java @@ -24,7 +24,7 @@ public class PermissionController { private ISysPermissionService iSysPermissionService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "queryMode", paramType = "query", dataType = "QueryModeEnum"), @ApiImplicitParam(name = "page", defaultValue = "1", value = "页码", paramType = "query", dataType = "Integer"), @@ -63,7 +63,7 @@ public class PermissionController { } } - @ApiOperation(value = "权限详情", httpMethod = "GET") + @ApiOperation(value = "权限详情") @ApiImplicitParam(name = "id", value = "权限ID", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail(@PathVariable Long id) { @@ -71,7 +71,7 @@ public class PermissionController { return Result.success(permission); } - @ApiOperation(value = "新增权限", httpMethod = "POST") + @ApiOperation(value = "新增权限") @ApiImplicitParam(name = "permission", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysPermission") @PostMapping public Result add(@RequestBody SysPermission permission) { @@ -82,7 +82,7 @@ public class PermissionController { return Result.judge(result); } - @ApiOperation(value = "修改权限", httpMethod = "PUT") + @ApiOperation(value = "修改权限") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "权限id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "permission", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysPermission") @@ -98,7 +98,7 @@ public class PermissionController { return Result.judge(result); } - @ApiOperation(value = "删除权限", httpMethod = "DELETE") + @ApiOperation(value = "删除权限") @ApiImplicitParam(name = "ids", value = "id集合", required = true, paramType = "query", dataType = "Long") @DeleteMapping("/{ids}") public Result delete(@PathVariable String ids) { diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/RoleController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/RoleController.java index 3bc8cfd66..4fc10fee4 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/RoleController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/RoleController.java @@ -41,7 +41,7 @@ public class RoleController { private ISysPermissionService iSysPermissionService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "queryMode", paramType = "query", dataType = "QueryModeEnum"), @ApiImplicitParam(name = "page", value = "页码", paramType = "query", dataType = "Long"), @@ -76,7 +76,7 @@ public class RoleController { } - @ApiOperation(value = "新增角色", httpMethod = "POST") + @ApiOperation(value = "新增角色") @ApiImplicitParam(name = "role", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysRole") @PostMapping public Result add(@RequestBody SysRole role) { @@ -87,7 +87,7 @@ public class RoleController { return Result.judge(result); } - @ApiOperation(value = "修改角色", httpMethod = "PUT") + @ApiOperation(value = "修改角色") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "角色id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "role", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysRole") @@ -103,7 +103,7 @@ public class RoleController { return Result.judge(result); } - @ApiOperation(value = "删除角色", httpMethod = "DELETE") + @ApiOperation(value = "删除角色") @ApiImplicitParam(name = "ids", value = "以,分割拼接字符串", required = true, dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable String ids) { @@ -115,7 +115,7 @@ public class RoleController { return Result.judge(result); } - @ApiOperation(value = "局部更新角色", httpMethod = "PATCH") + @ApiOperation(value = "局部更新角色") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "role", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysRole") @@ -132,7 +132,7 @@ public class RoleController { return Result.judge(result); } - @ApiOperation(value = "角色拥有的菜单ID集合", httpMethod = "GET") + @ApiOperation(value = "角色拥有的菜单ID集合") @ApiImplicitParam(name = "id", value = "角色id", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}/menu_ids") public Result roleMenuIds(@PathVariable("id") Long roleId) { @@ -140,7 +140,7 @@ public class RoleController { return Result.success(menuIds); } - @ApiOperation(value = "角色拥有的权限ID集合", httpMethod = "GET") + @ApiOperation(value = "角色拥有的权限ID集合") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "角色id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "type", value = "权限类型", paramType = "query", dataType = "Integer"), @@ -152,7 +152,7 @@ public class RoleController { } - @ApiOperation(value = "修改角色菜单", httpMethod = "PUT") + @ApiOperation(value = "修改角色菜单") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "角色id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "role", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysRole") @@ -167,7 +167,7 @@ public class RoleController { return Result.judge(result); } - @ApiOperation(value = "修改角色权限", httpMethod = "PUT") + @ApiOperation(value = "修改角色权限") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "角色id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "rolePermission", value = "实体JSON对象", required = true, paramType = "body", dataType = "RolePermissionDTO") diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/TokenController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/TokenController.java index 720378064..ca584835a 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/TokenController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/TokenController.java @@ -28,7 +28,7 @@ public class TokenController { ITokenService tokenService; - @ApiOperation(value = "强制下线", httpMethod = "POST") + @ApiOperation(value = "强制下线") @ApiImplicitParam(name = "token", value = "访问令牌", required = true, paramType = "query", dataType = "String") @PostMapping("/{token}/_invalidate") @SneakyThrows diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java index 861622f57..7ecd245fd 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java @@ -42,7 +42,7 @@ public class UserController extends BaseController { private final ISysPermissionService iSysPermissionService; - @ApiOperation(value = "列表分页", httpMethod = "GET") + @ApiOperation(value = "列表分页") @ApiImplicitParams({ @ApiImplicitParam(name = "page", value = "页码", paramType = "query", dataType = "Long"), @ApiImplicitParam(name = "limit", value = "每页数量", paramType = "query", dataType = "Long"), @@ -71,7 +71,7 @@ public class UserController extends BaseController { return Result.success(result.getRecords(), result.getTotal()); } - @ApiOperation(value = "用户详情", httpMethod = "GET") + @ApiOperation(value = "用户详情") @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long") @GetMapping("/{id}") public Result detail( @@ -88,7 +88,7 @@ public class UserController extends BaseController { return Result.success(user); } - @ApiOperation(value = "新增用户", httpMethod = "POST") + @ApiOperation(value = "新增用户") @ApiImplicitParam(name = "user", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysUser") @PostMapping public Result add(@RequestBody SysUser user) { @@ -96,7 +96,7 @@ public class UserController extends BaseController { return Result.judge(result); } - @ApiOperation(value = "修改用户", httpMethod = "PUT") + @ApiOperation(value = "修改用户") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "user", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysUser") @@ -109,7 +109,7 @@ public class UserController extends BaseController { return Result.judge(result); } - @ApiOperation(value = "删除用户", httpMethod = "DELETE") + @ApiOperation(value = "删除用户") @ApiImplicitParam(name = "ids", value = "id集合", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable String ids) { @@ -117,7 +117,7 @@ public class UserController extends BaseController { return Result.judge(status); } - @ApiOperation(value = "局部更新", httpMethod = "PATCH") + @ApiOperation(value = "局部更新") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "user", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysUser") @@ -138,7 +138,7 @@ public class UserController extends BaseController { * @param username * @return */ - @ApiOperation(value = "根据用户名获取用户信息", httpMethod = "GET") + @ApiOperation(value = "根据用户名获取用户信息") @ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "path", dataType = "String") @GetMapping("/username/{username}") public Result getUserByUsername( @@ -166,7 +166,7 @@ public class UserController extends BaseController { } - @ApiOperation(value = "获取当前用户信息", httpMethod = "GET") + @ApiOperation(value = "获取当前用户信息") @GetMapping("/me") public Result getCurrentUser() { UserVO userVO = new UserVO();