feat:订单整理

This commit is contained in:
haoxr 2021-03-19 20:36:11 +08:00
parent dcafce487a
commit fcfee11062
47 changed files with 250 additions and 340 deletions

View File

@ -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;
}

View File

@ -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<OrderItemVO> orderItems;
private List<OrderItemDTO> 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;
}

View File

@ -32,7 +32,7 @@ public class CartVO implements Serializable {
private Long coupon;
private boolean checked;
private Boolean checked;
private Integer stock;// 商品库存数量页面控制能选择最大数量

View File

@ -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<OrderItemVO> orderItems;
private List<OrderItemDTO> orderItems;
private List<UmsAddress> addresses;

View File

@ -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;
}

View File

@ -14,10 +14,11 @@ public class OrderSubmitVO extends BaseVO {
/**
* 订单ID
*/
private Long id;
private Long orderId;
/**
* 订单
* 订单进入支付页面显示
*/
private String orderSn;
}

View File

@ -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;
}

View File

@ -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:";

View File

@ -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) {

View File

@ -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<OrderConfirmVO> 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<OrderListVO>> list(
@ -54,5 +77,4 @@ public class OrderController {
List<OrderListVO> orderList = orderService.list(status);
return Result.success(orderList);
}
}

View File

@ -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);
}
}

View File

@ -12,7 +12,7 @@ public interface ICartService {
CartVO getCart();
List<CartVO.CartItem> getCartItems();
List<CartVO.CartItem> getCartItems(Long memberId);
boolean deleteCart();

View File

@ -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<OmsOrderPay> {
boolean pay(Long orderId);
PayVO getByOrderId(Long orderId);
}

View File

@ -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<CartVO.CartItem> cartItems = cartHashOperations.values();
cart.setItems(cartItems);
return cart;
}
@Override
public List<CartVO.CartItem> getCartItems() {
BoundHashOperations cartHashOperations = getCartHashOperations();
public List<CartVO.CartItem> getCartItems(Long memberId) {
BoundHashOperations cartHashOperations = getCartHashOperations(memberId);
List<CartVO.CartItem> 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;
}

View File

@ -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<OrderPayMapper, OmsOrderPay
private IOrderService orderService;
private UmsMemberFeignService memberFeignService;
private PmsSkuFeignService skuFeignService;
private ICartService cartService;
@Override
@GlobalTransactional(rollbackFor = Exception.class)
@ -44,39 +45,25 @@ public class OrderPayServiceImpl extends ServiceImpl<OrderPayMapper, OmsOrderPay
Long userId = RequestUtils.getUserId();
Long payAmount = order.getPayAmount();
Result deductBalanceResult = memberFeignService.deductBalance(userId, payAmount);
if (Result.isSuccess(deductBalanceResult)) {
if (!Result.isSuccess(deductBalanceResult)) {
throw new BizException("扣减账户余额失败");
}
// 扣减库存
Result deductStockResult = skuFeignService.deductStock(order.getOrderSn());
if (Result.isSuccess(deductStockResult)) {
if (!Result.isSuccess(deductStockResult)) {
throw new BizException("扣减商品库存失败");
}
// 更新订单
// 更新订单状态
order.setStatus(OrderStatusEnum.PAID.getCode());
order.setPayType(PayTypeEnum.BALANCE.getCode());
order.setPayTime(new Date());
boolean result = orderService.updateById(order);
orderService.updateById(order);
return result;
// 支付成功删除购物车已勾选的商品
cartService.removeCheckedItem();
return true;
}
@Override
public PayVO getByOrderId(Long orderId) {
PayVO payVO = new PayVO();
// 1获取订单应支付金额
OmsOrder omsOrder = orderService.getByOrderId(orderId);
payVO.setPayAmount(omsOrder.getPayAmount());
// 2获取会员余额
Long userId = RequestUtils.getUserId();
Long balance = memberFeignService.getBalance(userId).getData();
payVO.setBalance(balance);
return payVO;
}
}

View File

@ -16,11 +16,11 @@ import com.youlai.mall.oms.mapper.OrderMapper;
import com.youlai.mall.oms.pojo.domain.OmsOrder;
import com.youlai.mall.oms.pojo.domain.OmsOrderItem;
import com.youlai.mall.oms.pojo.dto.OrderConfirmDTO;
import com.youlai.mall.oms.pojo.dto.OrderItemDTO;
import com.youlai.mall.oms.pojo.dto.OrderSubmitDTO;
import com.youlai.mall.oms.pojo.vo.*;
import com.youlai.mall.oms.service.ICartService;
import com.youlai.mall.oms.service.IOrderItemService;
import com.youlai.mall.oms.service.IOrderLogService;
import com.youlai.mall.oms.service.IOrderService;
import com.youlai.mall.pms.api.app.PmsSkuFeignService;
import com.youlai.mall.pms.pojo.domain.PmsSku;
@ -55,7 +55,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OmsOrder> 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<OrderMapper, OmsOrder> impleme
@Override
public OrderConfirmVO confirm(OrderConfirmDTO orderConfirmDTO) {
OrderConfirmVO orderConfirmVO = new OrderConfirmVO();
Long memberId = RequestUtils.getUserId();
// 获取购买商品信息
CompletableFuture<Void> orderItemsCompletableFuture = CompletableFuture.runAsync(() -> {
List<OrderItemVO> orderItems = new ArrayList<>();
List<OrderItemDTO> 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<CartVO.CartItem> cartItems = cartService.getCartItems();
List<OrderItemVO> items = cartItems.stream()
.filter(CartVO.CartItem::isChecked)
.map(cartItem -> OrderItemVO.builder()
List<CartVO.CartItem> cartItems = cartService.getCartItems(memberId);
List<OrderItemDTO> 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<OrderMapper, OmsOrder> impleme
// 获取会员地址列表
CompletableFuture<Void> addressesCompletableFuture = CompletableFuture.runAsync(() -> {
List<UmsAddress> addresses = addressFeignService.list().getData();
List<UmsAddress> addresses = addressFeignService.list(memberId).getData();
orderConfirmVO.setAddresses(addresses);
}, threadPoolExecutor);
@ -110,7 +110,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OmsOrder> 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<OrderMapper, OmsOrder> impleme
DefaultRedisScript<Long> 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<OrderItemVO> orderItems = submitDTO.getOrderItems();
List<OrderItemDTO> orderItems = submitDTO.getOrderItems();
if (CollectionUtil.isEmpty(orderItems)) {
throw new BizException("请选择商品再提交");
}
@ -168,7 +168,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OmsOrder> 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<OrderMapper, OmsOrder> 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<OrderMapper, OmsOrder> 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;
}

View File

@ -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<PmsAttribute> attributes) {

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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<PmsSpecification> specCategories) {

View File

@ -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")

View File

@ -26,7 +26,7 @@ public class CategoryController {
private IPmsCategoryService iPmsCategoryService;
@ApiOperation(value = "分类列表", httpMethod = "GET")
@ApiOperation(value = "分类列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "parentId", paramType = "query", dataType = "Long")
})

View File

@ -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) {

View File

@ -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"),
})

View File

@ -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<Boolean> lockStock(@RequestBody List<SkuLockDTO> 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<Boolean> 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<Boolean> 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<Long> ids) {

View File

@ -42,7 +42,7 @@ public class PmsSkuServiceImpl extends ServiceImpl<PmsSkuMapper, PmsSku> impleme
@Override
public boolean lockStock(List<SkuLockDTO> skuLockList) {
if (CollectionUtil.isNotEmpty(skuLockList)) {
if (CollectionUtil.isEmpty(skuLockList)) {
throw new BizException("锁定的商品列表为空");
}
@ -113,7 +113,7 @@ public class PmsSkuServiceImpl extends ServiceImpl<PmsSkuMapper, PmsSku> 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;
}

View File

@ -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")

View File

@ -23,7 +23,7 @@ public class AdvertController {
private ISmsAdvertService iSmsAdvertService;
@ApiOperation(value = "列表分页", httpMethod = "GET")
@ApiOperation(value = "列表分页")
@GetMapping
public Result list() {
LambdaQueryWrapper<SmsAdvert> queryWrapper = new LambdaQueryWrapper<SmsAdvert>()

View File

@ -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<UmsAddress>> list();
Result<List<UmsAddress>> list(@RequestParam Long memberId);
}

View File

@ -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;

View File

@ -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) {

View File

@ -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();

View File

@ -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<UmsAddress> addressList = iUmsAddressService.list(new LambdaQueryWrapper<UmsAddress>()
.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<UmsAddress>()
.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<UmsAddress>()
.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<UmsAddress> updateWrapper = new LambdaUpdateWrapper<UmsAddress>()
.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<UmsAddress>()
.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<UmsAddress> getAddressById(@PathVariable("id") String id) {

View File

@ -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<Long> updateBalance(@PathVariable Long id) {

View File

@ -40,7 +40,7 @@ public class DashboardController {
ElasticSearchService elasticSearchService;
@ApiOperation(value = "控制台数据", httpMethod = "GET")
@ApiOperation(value = "控制台数据")
@GetMapping
public Result data() {
Map<String, Object> data = new HashMap<>();

View File

@ -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) {

View File

@ -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")

View File

@ -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")

View File

@ -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<BaseDocument> documents) {

View File

@ -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")

View File

@ -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"),
})

View File

@ -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) {

View File

@ -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) {

View File

@ -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")

View File

@ -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

View File

@ -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<UserVO> getCurrentUser() {
UserVO userVO = new UserVO();