build: validation
This commit is contained in:
parent
ec4bfe6515
commit
5461963d5f
|
@ -19,6 +19,11 @@
|
||||||
<version>${mybatis-plus-starter.version}</version>
|
<version>${mybatis-plus-starter.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package io.metersphere.domain;
|
package io.metersphere.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@ -8,8 +9,9 @@ import java.io.Serializable;
|
||||||
@Data
|
@Data
|
||||||
@TableName(value = "user", autoResultMap = true)
|
@TableName(value = "user", autoResultMap = true)
|
||||||
public class User implements Serializable {
|
public class User implements Serializable {
|
||||||
|
@NotBlank(message = "id不能为空")
|
||||||
private String id;
|
private String id;
|
||||||
|
@NotBlank(message = "用户名不能为空")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
Loading…
Reference in New Issue