| | |
| | | import cc.mrbird.febs.mall.vo.AdminMallNewsInfoVo; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | // if(mallNewsInfoDto.getType() == 2){ |
| | | // mallNewsInfo.setTargetId(mallNewsInfoDto.getGoodsId()); |
| | | // } |
| | | |
| | | String content = mallNewsInfoDto.getContent(); |
| | | if(StrUtil.isNotBlank(content)){ |
| | | //正文图片样式居中 |
| | | mallNewsInfoDto.setContent(content+"<style>img{max-width:100%!important;}</style>"); |
| | | } |
| | | MallNewsInfo mallNewsInfo = new MallNewsInfo(); |
| | | BeanUtil.copyProperties(mallNewsInfoDto, mallNewsInfo); |
| | | this.baseMapper.insert(mallNewsInfo); |
| | |
| | | // this.baseMapper.insert(mallNewsInfo); |
| | | // this.baseMapper.deleteById(mallNewsInfoDto.getId()); |
| | | |
| | | String content = mallNewsInfoDto.getContent(); |
| | | if(StrUtil.isNotBlank(content)){ |
| | | //正文图片样式居中 |
| | | mallNewsInfoDto.setContent(content+"<style>img{max-width:100%!important;}</style>"); |
| | | } |
| | | MallNewsInfo mallNewsInfo = new MallNewsInfo(); |
| | | BeanUtil.copyProperties(mallNewsInfoDto, mallNewsInfo); |
| | | this.baseMapper.updateById(mallNewsInfo); |
| | |
| | | public List<MallNewsCategory> findAllCategory() { |
| | | return mallNewsCategoryMapper.selectList(null); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse delNewsCategoryInfo(Long id) { |
| | | MallNewsCategory mallNewsCategory = mallNewsCategoryMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(mallNewsCategory)){ |
| | | return new FebsResponse().fail().message("系统繁忙,请刷新页面重试"); |
| | | } |
| | | mallNewsCategoryMapper.deleteById(id); |
| | | return new FebsResponse().success(); |
| | | } |
| | | } |