新建动态标题重复异常抛出错误

This commit is contained in:
pserimal
2023-06-30 10:44:07 +08:00
parent 594ad18db7
commit 76e866731a

View File

@@ -41,7 +41,7 @@ public class ContentServiceImpl implements ContentService {
//增加不允许重复标题的逻辑 //增加不允许重复标题的逻辑
Boolean isDuplicated = contentInfoMapper.whetherTitleDuplicated(dto.getContentTitle()); Boolean isDuplicated = contentInfoMapper.whetherTitleDuplicated(dto.getContentTitle());
if (isDuplicated) { if (isDuplicated) {
throw new ApiException(ErrorCodeEnum.DATA_CONVERT_ERROR); throw new ApiException(ErrorCodeEnum.CONTENT_DUPLICATED);
} }
HyContentInfoDO hyContentInfoDO = new HyContentInfoDO(); HyContentInfoDO hyContentInfoDO = new HyContentInfoDO();
BeanUtil.copyProperties(dto, hyContentInfoDO); BeanUtil.copyProperties(dto, hyContentInfoDO);