build: validation

This commit is contained in:
CaptainB 2023-04-18 14:35:14 +08:00
parent ec4bfe6515
commit 5461963d5f
2 changed files with 8 additions and 1 deletions

View File

@ -19,6 +19,11 @@
<version>${mybatis-plus-starter.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -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;