| | |
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | |
| | | record.setParams(null);
|
| | | } else if (!StringUtil.isJson(params)) {
|
| | | throw new SwiperPictureException(1, "跳转参数非JSON格式");
|
| | | } else {
|
| | | record.setParams(params.trim());
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(jumpType)) {
|
| | |
| | | String type = contentType.substring(contentType.indexOf("/") + 1);
|
| | |
|
| | | // 文件路径
|
| | | String filePath = "/img/swiperPic/" + UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | String filePath = FilePathEnum.swiper.getPath() + UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | // 执行上传
|
| | | String fileLink = COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public int deleteBatchByPrimaryKey(List<Long> list) throws SwiperPictureException {
|
| | |
|
| | | List<SwiperPicture> listSwiper = swiperPictureMapper.queryByListPrimaryKey(list);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (listSwiper != null)
|
| | | for (SwiperPicture picture : listSwiper) {
|
| | | List<AdActivityVersionControl> versionList = adActivityVersionControlService
|
| | | .listByTypeAndSourceId(AdActivityType.banner, picture.getId());
|
| | | if (versionList != null)
|
| | | for (AdActivityVersionControl control : versionList)
|
| | | adActivityVersionControlService.deleteByPrimaryKey(control.getId());
|
| | | }
|
| | | return swiperPictureMapper.deleteBatchByPrimaryKey(list);
|
| | | }
|
| | |
|
| | |
| | | public List<SwiperPicture> getByBannerCardAndVersion(String card, String platform, int version) {
|
| | | List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card);
|
| | | filterSwipePicture(list, platform, version);
|
| | | for (SwiperPicture picture : list) {
|
| | | if (picture.isJumpNeedLogin() && picture.getJumpDetail() != null) {
|
| | | picture.getJumpDetail().setNeedLogin(true);
|
| | | }
|
| | | }
|
| | |
|
| | | return list;
|
| | | }
|
| | |
|