admin
2020-05-06 24a8d17e007545f7426c48352109aa1a9c6587ee
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java
@@ -214,11 +214,36 @@
         COSManager.getInstance().deleteFile(picture);
      }
   }
   @Override
   public void switchState(Long id) throws SwiperPictureException {
      if (id == null) {
         throw new SwiperPictureException(1, "请传递正确参数");
      }
      SwiperPicture resultObj = swiperPictureMapper.selectByPrimaryKey(id);
      if (resultObj == null) {
         throw new SwiperPictureException(1, "此内容已不存在");
      }
      Integer state = resultObj.getState();
      if (state == null || state == 0) {
         state = 1;
      } else {
         state = 0;
      }
      SwiperPicture updateObj = new SwiperPicture();
      updateObj.setId(id);
      updateObj.setState(state);
      updateObj.setJumpNeedLogin(resultObj.isJumpNeedLogin());
      swiperPictureMapper.updateByPrimaryKeySelective(updateObj);
   }
   @Override
   @Transactional(rollbackFor = Exception.class)
   public int deleteBatchByPrimaryKey(List<Long> list) throws SwiperPictureException {
      List<SwiperPicture> listSwiper = swiperPictureMapper.queryByListPrimaryKey(list);
      for (SwiperPicture swiperPicture : listSwiper) {
         String src = swiperPicture.getSrc();