| | |
| | | import cn.lili.common.enums.ResultCode; |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.exception.ServiceException; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.vo.PageVO; |
| | | import cn.lili.common.vo.ResultMessage; |
| | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 买家端,商品接口 |
| | |
| | | return ResultUtil.data(hotWords); |
| | | } |
| | | |
| | | @ApiOperation(value = "供应商分页获取商品列表") |
| | | @GetMapping(value = "/store/list") |
| | | public ResultMessage<IPage<Goods>> getManagerPage(GoodsSearchParams goodsSearchParams) { |
| | | //获取当前登录商家账号 |
| | | String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); |
| | | goodsSearchParams.setStoreId(storeId); |
| | | IPage<Goods> page = goodsService.queryByParams(goodsSearchParams); |
| | | page.getRecords().forEach(goodsVO -> { |
| | | if (StringUtils.isNotBlank(goodsVO.getOriginal())) { |
| | | goodsVO.setOriginal(cosUtil.getPreviewUrl(goodsVO.getOriginal())); |
| | | } |
| | | if (StringUtils.isNotBlank(goodsVO.getGoodsVideo())) { |
| | | goodsVO.setGoodsVideo(cosUtil.getPreviewUrl(goodsVO.getGoodsVideo())); |
| | | } |
| | | if (StringUtils.isNotBlank(goodsVO.getThumbnail())) { |
| | | goodsVO.setThumbnail(cosUtil.getPreviewUrl(goodsVO.getThumbnail())); |
| | | } |
| | | if (StringUtils.isNotBlank(goodsVO.getSmall())) { |
| | | goodsVO.setSmall(cosUtil.getPreviewUrl(goodsVO.getSmall())); |
| | | } |
| | | }); |
| | | return ResultUtil.data(page); |
| | | } |
| | | |
| | | } |