| | |
| | | import cn.lili.modules.goods.entity.dos.Goods; |
| | | import cn.lili.modules.goods.entity.dos.GoodsSku; |
| | | import cn.lili.modules.goods.entity.dto.GoodsSearchParams; |
| | | import cn.lili.modules.goods.entity.dto.GoodsSortDTO; |
| | | import cn.lili.modules.goods.entity.enums.GoodsAuthEnum; |
| | | import cn.lili.modules.goods.entity.enums.GoodsStatusEnum; |
| | | import cn.lili.modules.goods.entity.vos.GoodsSkuVO; |
| | | import cn.lili.modules.goods.entity.vos.GoodsVO; |
| | | import cn.lili.modules.goods.service.GoodsService; |
| | | import cn.lili.modules.goods.service.GoodsSkuService; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * 管理端,商品管理接口 |
| | |
| | | |
| | | @Autowired |
| | | private COSUtil cosUtil; |
| | | |
| | | @ApiOperation(value = "获得skuId") |
| | | @GetMapping("/getFirstSkuId/{id}") |
| | | public ResultMessage<String> getFirstSkuId(@PathVariable String id) { |
| | | List<GoodsSkuVO> goodsListByGoodsId = goodsSkuService.getGoodsListByGoodsId(id); |
| | | System.out.println(goodsListByGoodsId); |
| | | return ResultUtil.data(goodsListByGoodsId.get(0).getId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页获取") |
| | | @GetMapping(value = "/list") |
| | |
| | | } |
| | | throw new ServiceException(ResultCode.GOODS_UNDER_ERROR); |
| | | } |
| | | @DemoSite |
| | | @PostMapping(value = "/goods/sort") |
| | | public ResultMessage<Object> goodsSort(@RequestBody @Valid GoodsSortDTO req) { |
| | | if (Boolean.TRUE.equals(goodsService.goodsSort(req))) { |
| | | return ResultUtil.success(); |
| | | } |
| | | throw new RuntimeException("修改排序失败"); |
| | | } |
| | | |
| | | @PreventDuplicateSubmissions |
| | | @ApiOperation(value = "管理员审核商品", notes = "管理员审核商品") |