xiaoyong931011
2020-08-14 ee258d864ccf3b841712d7e36f530ca0ab789c63
src/main/java/com/xcong/excoin/modules/helpCenter/service/impl/HelpCenterServiceImpl.java
@@ -20,8 +20,10 @@
import com.xcong.excoin.common.entity.QueryRequest;
import com.xcong.excoin.modules.helpCenter.entity.HelpCenterArticleEntity;
import com.xcong.excoin.modules.helpCenter.entity.HelpCenterNoticeEntity;
import com.xcong.excoin.modules.helpCenter.entity.HelpCenterTypeEntity;
import com.xcong.excoin.modules.helpCenter.mapper.HelpCenterArticleMapper;
import com.xcong.excoin.modules.helpCenter.mapper.HelpCenterNoticeMapper;
import com.xcong.excoin.modules.helpCenter.mapper.HelpCenterTypeMapper;
import com.xcong.excoin.modules.helpCenter.service.HelpCenterService;
import cn.hutool.core.collection.CollUtil;
@@ -37,6 +39,8 @@
   private final HelpCenterNoticeMapper helpCenterNoticeMapper;
   
   private final HelpCenterArticleMapper helpCenterArticleMapper;
   private final HelpCenterTypeMapper helpCenterTypeMapper;
   
   @Override
   public IPage<HelpCenterNoticeEntity> findHelpCenterListInPage(HelpCenterNoticeEntity helpCenterNoticeEntity,
@@ -161,6 +165,31 @@
      return new FebsResponse().success();
   }
   
   @Override
   public IPage<HelpCenterTypeEntity> findHelpCenterTypeListInPage(HelpCenterTypeEntity helpCenterTypeEntity,
         QueryRequest request) {
      Page<HelpCenterTypeEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
      IPage<HelpCenterTypeEntity> helpCenterTypeEntitys = helpCenterTypeMapper.findHelpCenterTypeListInPage(page, helpCenterTypeEntity);
      return helpCenterTypeEntitys;
   }
   @Override
   public void helpCenterTypeAdds(@Valid HelpCenterTypeEntity helpCenterTypeEntity) {
      helpCenterTypeMapper.insert(helpCenterTypeEntity);
   }
   @Override
   public FebsResponse helpCenterTypeDelete(@NotNull(message = "{required}") Long id) {
      HelpCenterTypeEntity helpCenterTypeEntity = helpCenterTypeMapper.selectById(id);
      if(ObjectUtil.isEmpty(helpCenterTypeEntity)) {
         return new FebsResponse().fail().message("记录不存在");
      }
      helpCenterTypeMapper.deleteById(id);
      return new FebsResponse().success();
   }