diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/dict/vo/type/SysDictTypeBaseVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/dict/vo/type/SysDictTypeBaseVO.java index c4458cd26b..05d399e2f4 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/dict/vo/type/SysDictTypeBaseVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/dict/vo/type/SysDictTypeBaseVO.java @@ -23,6 +23,11 @@ public class SysDictTypeBaseVO { @NotNull(message = "状态不能为空") private Integer status; + @ApiModelProperty(value = "字典类型", required = true) + @NotNull(message = "字典类型不能为空") + @Size(max = 100, message = "字典类型长度不能超过100个字符") + private String type; + @ApiModelProperty(value = "备注", example = "快乐的备注") private String remark; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/dict/impl/SysDictTypeServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/dict/impl/SysDictTypeServiceImpl.java index b054764532..36a14b4152 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/dict/impl/SysDictTypeServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/service/dict/impl/SysDictTypeServiceImpl.java @@ -115,6 +115,10 @@ public class SysDictTypeServiceImpl implements SysDictTypeService { @VisibleForTesting public void checkDictTypeUnique(Long id, String type) { + // 判断type是否为空,减少一次查询数据库的操作 + if (type == null) { + return; + } SysDictTypeDO dictType = dictTypeMapper.selectByType(type); if (dictType == null) { return; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring.factories index 529a476630..3986b1c2b2 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring.factories +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring.factories @@ -1,2 +1,2 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - cn.iocoder.yudao.framework.operatelog.config.YudaoOperateLogAutoConfiguration + cn.iocoder.yudao.framework.dict.config.YudaoDictAutoConfiguration