From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 二月 2025 16:41:22 +0800 Subject: [PATCH] 淘宝转链接口更新 --- fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperBannerServiceImpl.java | 242 ++++++++++++++++++++++++------------------------ 1 files changed, 121 insertions(+), 121 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperBannerServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperBannerServiceImpl.java index 6a0712f..bd14dd2 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperBannerServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperBannerServiceImpl.java @@ -1,121 +1,121 @@ -package com.yeshi.fanli.service.impl.homemodule; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import com.yeshi.fanli.entity.SystemEnum; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.yeshi.utils.tencentcloud.COSManager; - -import com.yeshi.fanli.dao.mybatis.homemodule.SwiperBannerMapper; -import com.yeshi.fanli.entity.bus.homemodule.SwiperBanner; -import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture; -import com.yeshi.fanli.exception.banner.SwiperBannerException; -import com.yeshi.fanli.service.inter.homemodule.SwiperBannerService; -import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService; -import com.yeshi.fanli.util.StringUtil; - -@Service -public class SwiperBannerServiceImpl implements SwiperBannerService { - - @Resource - private SwiperBannerMapper swiperBannerMapper; - - @Resource - private SwiperPictureService swiperPictureService; - - - @Override - public int deleteByPrimaryKey(Long id) { - return swiperBannerMapper.deleteByPrimaryKey(id); - } - - @Override - public int insert(SwiperBanner record) { - return swiperBannerMapper.insert(record); - } - - @Override - public int insertSelective(SwiperBanner record) { - return swiperBannerMapper.insertSelective(record); - } - - @Override - public SwiperBanner selectByPrimaryKey(Long id) { - return swiperBannerMapper.selectByPrimaryKey(id); - } - - @Override - public int updateByPrimaryKeySelective(SwiperBanner record) { - return swiperBannerMapper.updateByPrimaryKeySelective(record); - } - - @Override - public int updateByPrimaryKey(SwiperBanner record) { - return swiperBannerMapper.updateByPrimaryKey(record); - } - - @Override - public List<SwiperBanner> query(long start, int count, String key, Integer sort, SystemEnum system) { - return swiperBannerMapper.query(start, count, key, sort, system); - } - - @Override - public long countQuery(String key, SystemEnum system) { - return swiperBannerMapper.countQuery(key, system); - } - - @Override - public void switchState(Long id) throws SwiperBannerException { - if (id == null) { - throw new SwiperBannerException(1, "璇蜂紶閫掓纭弬鏁�"); - } - - SwiperBanner resultObj = swiperBannerMapper.selectByPrimaryKey(id); - if (resultObj == null) { - throw new SwiperBannerException(1, "姝ゅ唴瀹瑰凡涓嶅瓨鍦�"); - } - - Integer state = resultObj.getState(); - if (state == null || state == 0) { - state = 1; - } else { - state = 0; - } - - SwiperBanner updateObj = new SwiperBanner(); - updateObj.setId(id); - updateObj.setState(state); - swiperBannerMapper.updateByPrimaryKeySelective(updateObj); - } - - - @Override - @Transactional(rollbackFor = Exception.class) - public int deleteBatchByPrimaryKey(List<Long> list) throws Exception { - List<Long> listPicID = new ArrayList<Long>(); - List<SwiperPicture> listPic = swiperPictureService.queryByListBannerID(list); - for (SwiperPicture swiperPicture : listPic) { - String src = swiperPicture.getSrc(); - if (!StringUtil.isNullOrEmpty(src)) { - COSManager.getInstance().deleteFile(src); - } - listPicID.add(swiperPicture.getId()); - } - - if (listPicID.size() > 0) { - swiperPictureService.deleteBatchByPrimaryKey(listPicID); - } - - return swiperBannerMapper.deleteBatchByPrimaryKey(list); - } - - @Override - public List<SwiperBanner> getEffectiveOption(SystemEnum system) { - return swiperBannerMapper.getEffectiveOption(system); - } -} - +package com.yeshi.fanli.service.impl.homemodule; + +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.Resource; + +import com.yeshi.fanli.entity.SystemEnum; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.yeshi.utils.tencentcloud.COSManager; + +import com.yeshi.fanli.dao.mybatis.homemodule.SwiperBannerMapper; +import com.yeshi.fanli.entity.bus.homemodule.SwiperBanner; +import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture; +import com.yeshi.fanli.exception.banner.SwiperBannerException; +import com.yeshi.fanli.service.inter.homemodule.SwiperBannerService; +import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService; +import com.yeshi.fanli.util.StringUtil; + +@Service +public class SwiperBannerServiceImpl implements SwiperBannerService { + + @Resource + private SwiperBannerMapper swiperBannerMapper; + + @Resource + private SwiperPictureService swiperPictureService; + + + @Override + public int deleteByPrimaryKey(Long id) { + return swiperBannerMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(SwiperBanner record) { + return swiperBannerMapper.insert(record); + } + + @Override + public int insertSelective(SwiperBanner record) { + return swiperBannerMapper.insertSelective(record); + } + + @Override + public SwiperBanner selectByPrimaryKey(Long id) { + return swiperBannerMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(SwiperBanner record) { + return swiperBannerMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(SwiperBanner record) { + return swiperBannerMapper.updateByPrimaryKey(record); + } + + @Override + public List<SwiperBanner> query(long start, int count, String key, Integer sort, SystemEnum system) { + return swiperBannerMapper.query(start, count, key, sort, system); + } + + @Override + public long countQuery(String key, SystemEnum system) { + return swiperBannerMapper.countQuery(key, system); + } + + @Override + public void switchState(Long id) throws SwiperBannerException { + if (id == null) { + throw new SwiperBannerException(1, "璇蜂紶閫掓纭弬鏁�"); + } + + SwiperBanner resultObj = swiperBannerMapper.selectByPrimaryKey(id); + if (resultObj == null) { + throw new SwiperBannerException(1, "姝ゅ唴瀹瑰凡涓嶅瓨鍦�"); + } + + Integer state = resultObj.getState(); + if (state == null || state == 0) { + state = 1; + } else { + state = 0; + } + + SwiperBanner updateObj = new SwiperBanner(); + updateObj.setId(id); + updateObj.setState(state); + swiperBannerMapper.updateByPrimaryKeySelective(updateObj); + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public int deleteBatchByPrimaryKey(List<Long> list) throws Exception { + List<Long> listPicID = new ArrayList<Long>(); + List<SwiperPicture> listPic = swiperPictureService.queryByListBannerID(list); + for (SwiperPicture swiperPicture : listPic) { + String src = swiperPicture.getSrc(); + if (!StringUtil.isNullOrEmpty(src)) { + COSManager.getInstance().deleteFile(src); + } + listPicID.add(swiperPicture.getId()); + } + + if (listPicID.size() > 0) { + swiperPictureService.deleteBatchByPrimaryKey(listPicID); + } + + return swiperBannerMapper.deleteBatchByPrimaryKey(list); + } + + @Override + public List<SwiperBanner> getEffectiveOption(SystemEnum system) { + return swiperBannerMapper.getEffectiveOption(system); + } +} + -- Gitblit v1.8.0