zxl
昨天 7ec17b93b34a060233e5f193fa47fa243f7efafc
framework/src/main/java/cn/lili/modules/lmk/service/impl/PrizeActivityServiceImpl.java
@@ -2,6 +2,7 @@
import cn.lili.common.utils.StringUtils;
import cn.lili.modules.lmk.domain.vo.ActivityRefPrizeInfoVO;
import cn.lili.modules.lmk.domain.vo.PrizeDetailVO;
import cn.lili.modules.lmk.enums.general.PrizeActivityStatusEnum;
import cn.lili.modules.lmk.service.ActivityRefPrizeService;
import cn.lili.utils.COSUtil;
@@ -16,8 +17,6 @@
import cn.lili.modules.lmk.domain.form.PrizeActivityForm;
import cn.lili.modules.lmk.domain.vo.PrizeActivityVO;
import cn.lili.modules.lmk.domain.query.PrizeActivityQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor;
import cn.lili.utils.PageUtil;
@@ -45,6 +44,21 @@
    private final COSUtil cOSUtil;
    @Override
    public Result getONPrizeActivity(){
        PrizeActivity prizeActivity = new LambdaQueryChainWrapper<>(baseMapper)
                .eq(PrizeActivity::getDeleteFlag,Boolean.FALSE)
                .eq(PrizeActivity::getEnableStatus,PrizeActivityStatusEnum.ON.name())
                .one();
        PrizeActivityVO prizeActivityVO = new PrizeActivityVO();
        if (prizeActivity != null){
            PrizeActivityVO vo = PrizeActivityVO.getVoByEntity(prizeActivity, prizeActivityVO);
            if (StringUtils.isNotBlank(vo.getActivityCover())){
                vo.setActivityCoverUrl(cOSUtil.getPreviewUrl(vo.getActivityCover()));
            }
        }
        return Result.ok().data(prizeActivityVO);
    }
    @Override
    public Result getPopup() {
@@ -54,9 +68,11 @@
                .eq(PrizeActivity::getPopup,Boolean.TRUE)
                .one();
        PrizeActivityVO prizeActivityVO = new PrizeActivityVO();
        PrizeActivityVO vo = PrizeActivityVO.getVoByEntity(prizeActivity, prizeActivityVO);
        if (StringUtils.isNotBlank(vo.getActivityCover())){
            vo.setActivityCoverUrl(cOSUtil.getPreviewUrl(vo.getActivityCover()));
        if (prizeActivity != null){
            PrizeActivityVO vo = PrizeActivityVO.getVoByEntity(prizeActivity, prizeActivityVO);
            if (StringUtils.isNotBlank(vo.getActivityCover())){
                vo.setActivityCoverUrl(cOSUtil.getPreviewUrl(vo.getActivityCover()));
            }
        }
        return Result.ok().data(prizeActivityVO);
    }
@@ -229,4 +245,9 @@
                .collect(Collectors.toList());
        return Result.ok().data(vos);
    }
    @Override
    public PrizeDetailVO prizeInfo(String id) {
        return prizeActivityMapper.prizeInfo(id);
    }
}