From 58e0679060b7421f30df7996b39b99f2d236854d Mon Sep 17 00:00:00 2001 From: manailin <261030956@qq.com> Date: 星期日, 11 九月 2022 17:39:37 +0800 Subject: [PATCH] [修改] 三说代码部分提交 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoEventServiceImpl.java | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoEventServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoEventServiceImpl.java index cbdfbd1..641ce06 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoEventServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoEventServiceImpl.java @@ -1,6 +1,5 @@ package com.panzhihua.service_community.service.impl; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoEventDTO; @@ -11,40 +10,39 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; - import java.util.Date; -import java.util.List; import static java.util.Objects.isNull; @Service -public class ComSanShuoEventServiceImpl extends ServiceImpl<ComSanshuoEventDao, ComSanshuoEvent> implements ComSanShuoEventService { +public class ComSanShuoEventServiceImpl extends ServiceImpl<ComSanshuoEventDao, ComSanshuoEvent> implements ComSanShuoEventService { @Resource private ComSanshuoEventDao sanshuoEventDao; /** * 添加或修改事件类型 + * * @param comSanshuoEvent - * @return 处理结果 - * */ + * @return 处理结果 + */ @Override public R addOrUpdate(ComSanshuoEvent comSanshuoEvent) { - if (isNull(comSanshuoEvent.getName())){ + if (isNull(comSanshuoEvent.getName())) { return R.fail("名称不能为空!"); } - if (isNull(comSanshuoEvent.getId())){ + if (isNull(comSanshuoEvent.getId())) { //添加操作 comSanshuoEvent.setCreateTime(new Date()); int insert = sanshuoEventDao.insert(comSanshuoEvent); - if (insert>0){ + if (insert > 0) { return R.ok(); } } //修改 comSanshuoEvent.setUpdateTime(new Date()); int i = sanshuoEventDao.updateById(comSanshuoEvent); - if (i>0){ + if (i > 0) { return R.ok(); } return R.fail("操作失败"); @@ -52,11 +50,12 @@ /** * 后台获取事件类型列表 + * * @param comSanshuoEventDTO - * @return 处理结果 - * */ + * @return 处理结果 + */ @Override public R backStageList(ComSanshuoEventDTO comSanshuoEventDTO) { - return R.ok(this.baseMapper.pageEvent(new Page(comSanshuoEventDTO.getPage(),comSanshuoEventDTO.getSize()),comSanshuoEventDTO)) ; + return R.ok(this.baseMapper.pageEvent(new Page(comSanshuoEventDTO.getPage(), comSanshuoEventDTO.getSize()), comSanshuoEventDTO)); } } -- Gitblit v1.7.1