|
@@ -1,5 +1,7 @@
|
|
|
package org.dromara.system.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import org.dromara.common.core.exception.ServiceException;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
@@ -158,6 +160,12 @@ public class AppEventMdServiceImpl implements IAppEventMdService {
|
|
|
*/
|
|
|
@Override
|
|
|
public Boolean editByBo(AppEventMdBo bo) {
|
|
|
+ if (StrUtil.isBlank(bo.getTitle())) {
|
|
|
+ throw new ServiceException("标题不能为空");
|
|
|
+ }
|
|
|
+ if (StrUtil.isBlank(bo.getContent())) {
|
|
|
+ throw new ServiceException("内容不能为空");
|
|
|
+ }
|
|
|
//查询是否存在
|
|
|
AppEventMdVo vo = this.queryByEventIdAndType(bo.getEventId(), bo.getType());
|
|
|
if (Optional.ofNullable(vo).isPresent()) {
|
|
@@ -184,7 +192,7 @@ public class AppEventMdServiceImpl implements IAppEventMdService {
|
|
|
appEventMd.setContent("");
|
|
|
appEventMd.setType(type);
|
|
|
appEventMd.setRemark("");
|
|
|
- return baseMapper.update(appEventMd,Wrappers.lambdaQuery(AppEventMd.class)
|
|
|
+ return baseMapper.update(appEventMd, Wrappers.lambdaQuery(AppEventMd.class)
|
|
|
.eq(AppEventMd::getEventId, eventId)
|
|
|
.eq(AppEventMd::getType, type));
|
|
|
}
|