| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.modules.goods.entity.dos.GoodsSku; |
| | | import cn.lili.modules.goods.service.GoodsSkuService; |
| | | import cn.lili.modules.lmk.domain.entity.TemplateImgs; |
| | | import cn.lili.modules.lmk.domain.vo.CustomizeTemplateVO; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.GoodsCustomizeTemplate; |
| | | import cn.lili.modules.lmk.mapper.GoodsCustomizeTemplateMapper; |
| | |
| | | import cn.lili.modules.lmk.domain.form.GoodsCustomizeTemplateForm; |
| | | import cn.lili.modules.lmk.domain.vo.GoodsCustomizeTemplateVO; |
| | | import cn.lili.modules.lmk.domain.query.GoodsCustomizeTemplateQuery; |
| | | import jodd.util.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import cn.lili.utils.PageUtil; |
| | |
| | | |
| | | private final GoodsCustomizeTemplateMapper goodsCustomizeTemplateMapper; |
| | | |
| | | private final GoodsSkuService goodsSkuService; |
| | | |
| | | private final COSUtil cosUtil; |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | |
| | | @Override |
| | | public Result getCustomizeTemplate(String id) { |
| | | GoodsSku goodsSku = goodsSkuService.getById(id); |
| | | String templateId = goodsSku.getCustomizeTemplateId(); |
| | | CustomizeTemplateVO customizeTemplate = baseMapper.getCustomizeTemplate(templateId); |
| | | if (customizeTemplate != null) { |
| | | List<TemplateImgs> templateImgs = customizeTemplate.getTemplateImgs(); |
| | | if (!templateImgs.isEmpty()) { |
| | | for (TemplateImgs templateImg : templateImgs) { |
| | | String imgUrl = templateImg.getImgUrl(); |
| | | if (StringUtils.isNotBlank(imgUrl)&&!imgUrl.contains("http")) { |
| | | templateImg.setImgUrl(cosUtil.getPreviewUrl(imgUrl)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return Result.ok().data(customizeTemplate); |
| | | } |
| | | } |