1.增加直播商品

2.同步直播商品状态
3.展示状态展示直播商品列表
This commit is contained in:
lifenlong
2021-05-25 16:10:16 +08:00
parent d9ccc4a7b7
commit a9ec03f0a4
9 changed files with 88 additions and 25 deletions

View File

@@ -3,16 +3,16 @@ package cn.lili.controller.other.broadcast;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.utils.PageUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.broadcast.entity.dos.Commodity;
import cn.lili.modules.broadcast.service.CommodityService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -32,14 +32,19 @@ public class CommodityController {
private CommodityService commodityService;
@ApiOperation(value = "获取店铺直播商品列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "商品名称", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "auditStatus", value = "直播商品状态", dataType = "String", paramType = "query")
})
@GetMapping
public ResultMessage<IPage<Commodity>> page(PageVO pageVO) {
return ResultUtil.data(commodityService.page(PageUtil.initPage(pageVO)));
public ResultMessage<IPage<Commodity>> page(String auditStatus, String name, PageVO pageVO) {
return ResultUtil.data(commodityService.commodityList(pageVO, name, auditStatus));
}
@ApiOperation(value = "添加店铺直播商品")
@ApiImplicitParam(name = "commodityList", value = "直播商品列表", paramType = "body", allowMultiple = true, dataType = "Commodity")
@PostMapping
public ResultMessage<Object> addCommodity(@Validated List<Commodity> commodityList) {
public ResultMessage<Object> addCommodity(@RequestBody List<Commodity> commodityList) {
if (commodityService.addCommodity(commodityList)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
@@ -47,8 +52,9 @@ public class CommodityController {
}
@ApiOperation(value = "删除店铺直播商品")
@DeleteMapping
public ResultMessage<Object> delete(String goodsId) {
@ApiImplicitParam(name = "goodsId", value = "直播商品ID", dataType = "String", paramType = "path")
@DeleteMapping("/{goodsId}")
public ResultMessage<Object> delete(@PathVariable String goodsId) {
if (commodityService.deleteCommodity(goodsId)) {
return ResultUtil.success(ResultCode.SUCCESS);
}