| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.transaction.Transactional;
|
| | |
|
| | | 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.service.inter.homemodule.SwiperBannerService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | @Service
|
| | | public class SwiperBannerServiceImpl implements SwiperBannerService {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKeySelective(SwiperBanner record) throws SwiperBannerException{
|
| | | public int updateByPrimaryKeySelective(SwiperBanner record){
|
| | | return swiperBannerMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<SwiperBanner> query(long start, int count, String key, Integer sort) throws SwiperBannerException{
|
| | | public List<SwiperBanner> query(long start, int count, String key, Integer sort){
|
| | | return swiperBannerMapper.query(start, count, key, sort);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countQuery(String key) throws SwiperBannerException{
|
| | | public long countQuery(String key) {
|
| | | return swiperBannerMapper.countQuery(key);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | 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();
|