Browse Source

编写不重复时提示注解

pull/7/head
fanshuai 1 year ago
parent
commit
d9530a2a43
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java
  2. +1
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetVersionServiceImpl.java
  3. +1
    -1
      ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/DatasetDaoMapper.xml

+ 1
- 1
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java View File

@@ -356,7 +356,7 @@ public class DatasetServiceImpl implements DatasetService {
for (Field field : fields) { for (Field field : fields) {
if (field.isAnnotationPresent(CheckDuplicate.class)) { if (field.isAnnotationPresent(CheckDuplicate.class)) {
CheckDuplicate annotation = field.getAnnotation(CheckDuplicate.class); CheckDuplicate annotation = field.getAnnotation(CheckDuplicate.class);
throw new Exception(annotation.value() + "不能重复");
throw new Exception(field.getName()+ "不能重复");
} }
} }
} }


+ 1
- 1
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetVersionServiceImpl.java View File

@@ -162,7 +162,7 @@ public class DatasetVersionServiceImpl implements DatasetVersionService {
for (Field field : fields) { for (Field field : fields) {
if (field.isAnnotationPresent(CheckDuplicate.class)) { if (field.isAnnotationPresent(CheckDuplicate.class)) {
CheckDuplicate annotation = field.getAnnotation(CheckDuplicate.class); CheckDuplicate annotation = field.getAnnotation(CheckDuplicate.class);
throw new Exception(annotation.value() + "不能重复");
throw new Exception(field.getName() + "不能重复");
} }
} }
} }


+ 1
- 1
ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/DatasetDaoMapper.xml View File

@@ -29,7 +29,7 @@
select select
id,name,description,available_range,data_type,data_tag,create_by,create_time,update_by,update_time,state id,name,description,available_range,data_type,data_tag,create_by,create_time,update_by,update_time,state
from dataset from dataset
where name = #{name} and state = 1
where name = #{name} and state = 1 limit 1
</select> </select>
<!--查询指定行数据--> <!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="DatasetMap"> <select id="queryAllByLimit" resultMap="DatasetMap">


Loading…
Cancel
Save