| | |
| | | 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();
|