|
@@ -2,6 +2,7 @@ package com.chelvc.cloud.maintain.controller;
|
|
|
|
|
|
import com.chelvc.cloud.maintain.copier.MerchantCopier;
|
|
|
import com.chelvc.cloud.maintain.vo.SimpleMerchantVO;
|
|
|
+import com.chelvc.cloud.vehicle.api.constant.GoodsStatus;
|
|
|
import com.chelvc.cloud.vehicle.api.dto.BalanceDetailDTO;
|
|
|
import com.chelvc.cloud.vehicle.api.dto.MerchantDTO;
|
|
|
import com.chelvc.cloud.vehicle.api.dto.MerchantDetailDTO;
|
|
@@ -9,6 +10,7 @@ import com.chelvc.cloud.vehicle.api.dto.MerchantRankDTO;
|
|
|
import com.chelvc.cloud.vehicle.api.param.*;
|
|
|
import com.chelvc.cloud.vehicle.api.service.BalanceDetailService;
|
|
|
import com.chelvc.cloud.vehicle.api.service.FavoriteService;
|
|
|
+import com.chelvc.cloud.vehicle.api.service.GoodsService;
|
|
|
import com.chelvc.cloud.vehicle.api.service.MerchantService;
|
|
|
import com.chelvc.framework.base.annotation.ResponseWrapping;
|
|
|
import com.chelvc.framework.base.context.SessionContextHolder;
|
|
@@ -18,10 +20,12 @@ 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.RestController;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
import javax.validation.constraints.Min;
|
|
|
+import javax.validation.constraints.NotEmpty;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -42,6 +46,8 @@ public class MerchantController {
|
|
|
|
|
|
@DubboReference
|
|
|
private BalanceDetailService balanceDetailService;
|
|
|
+ @DubboReference
|
|
|
+ private GoodsService goodsService;
|
|
|
|
|
|
/**
|
|
|
* 获取商家列表
|
|
@@ -118,4 +124,38 @@ public class MerchantController {
|
|
|
return this.merchantService.getUserMineCartPaging(param);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上架商品
|
|
|
+ *
|
|
|
+ * @param goodsIds 商品ID集合
|
|
|
+ */
|
|
|
+ @PutMapping("/merchant/list-goods/{goodsIds}")
|
|
|
+ public void listGoods(@PathVariable("goodsIds") @NotEmpty(message = "商品ID不能为空") List<Long> goodsIds) {
|
|
|
+ this.goodsService.updateGoodsStatus(goodsIds, GoodsStatus.ONLINE);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下架商品
|
|
|
+ *
|
|
|
+ * @param goodsIds 商品ID集合
|
|
|
+ */
|
|
|
+ @PutMapping("/merchant/delist-goods/{goodsIds}")
|
|
|
+ public void delistGoods(@PathVariable("goodsIds") @NotEmpty(message = "商品ID不能为空") List<Long> goodsIds) {
|
|
|
+ this.goodsService.updateGoodsStatus(goodsIds, GoodsStatus.OFFLINE);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改商家营业状态
|
|
|
+ *
|
|
|
+ * @param id 商家主键
|
|
|
+ * @param businessStatus 修改参数 营业状态 0-营业中,1-休息中
|
|
|
+ */
|
|
|
+ @PutMapping("/merchant/updateBusinessStatus/{id}")
|
|
|
+ public void updateMerchant(@PathVariable("id") @Min(value = 1, message = "商家主键不能小于1") Long id,
|
|
|
+ String businessStatus) {
|
|
|
+ this.merchantService.updateMerchantBusinessStatus(id,businessStatus);
|
|
|
+ }
|
|
|
+
|
|
|
}
|