diff --git a/backend/framework/domain/pom.xml b/backend/framework/domain/pom.xml index b275d34324..02fc2afe53 100644 --- a/backend/framework/domain/pom.xml +++ b/backend/framework/domain/pom.xml @@ -19,6 +19,11 @@ ${mybatis-plus-starter.version} provided + + org.springframework.boot + spring-boot-starter-validation + provided + diff --git a/backend/framework/domain/src/main/java/io/metersphere/domain/User.java b/backend/framework/domain/src/main/java/io/metersphere/domain/User.java index e0ba975e20..ee71a72ddd 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/domain/User.java +++ b/backend/framework/domain/src/main/java/io/metersphere/domain/User.java @@ -1,6 +1,7 @@ package io.metersphere.domain; import com.baomidou.mybatisplus.annotation.TableName; +import jakarta.validation.constraints.NotBlank; import lombok.Data; import java.io.Serializable; @@ -8,8 +9,9 @@ import java.io.Serializable; @Data @TableName(value = "user", autoResultMap = true) public class User implements Serializable { + @NotBlank(message = "id不能为空") private String id; - + @NotBlank(message = "用户名不能为空") private String name; private String email;