|
@@ -1,4 +1,5 @@
|
|
|
package com.chelvc.cloud.maintain.controller;
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.MerchantCartItemDTO;
|
|
|
import com.chelvc.cloud.vehicle.api.dto.OmsCartItemDTO;
|
|
|
import com.chelvc.cloud.vehicle.api.param.OmsCartItemModifyParam;
|
|
|
import com.chelvc.cloud.vehicle.api.service.OmsCartItemService;
|
|
@@ -8,12 +9,14 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
import javax.validation.constraints.Min;
|
|
|
+import javax.validation.constraints.NotEmpty;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -66,13 +69,13 @@ public class CartItemController {
|
|
|
*
|
|
|
* @return 购物车主键
|
|
|
*/
|
|
|
- @GetMapping("/cartItem/deleteCartItem")
|
|
|
- public void deleteCartItem(@RequestParam("ids") List<Long> ids) {
|
|
|
+ @PutMapping("/cartItem/deleteCartItem/{ids}")
|
|
|
+ public void deleteCartItem( @PathVariable("ids") @NotEmpty(message = "购物车ID不能为空") List<Long> ids) {
|
|
|
this.cartItemService.delete(ids);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 新增购物车商品
|
|
|
+ * 修改购物车中商品的规格
|
|
|
*
|
|
|
* @param param 新增参数
|
|
|
* @return 购物车主键
|
|
@@ -81,4 +84,14 @@ public class CartItemController {
|
|
|
public Integer updateAttr(@RequestBody @Valid OmsCartItemModifyParam param) {
|
|
|
return this.cartItemService.updateAttr(param);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取商家购物车商品列表
|
|
|
+ *
|
|
|
+ * @return 购物车主键
|
|
|
+ */
|
|
|
+ @GetMapping("/listCartItem/{merchantId}")
|
|
|
+ public MerchantCartItemDTO listCartItem(@PathVariable("merchantId") @Min(value = 1, message = "商家主键不能小于1") Long merchantId) {
|
|
|
+ return this.cartItemService.listCartItem(merchantId);
|
|
|
+ }
|
|
|
}
|