mirror of
https://github.com/suyiiyii/SIMS.git
synced 2025-06-02 00:16:11 +08:00
feat(user): 为用户表添加唯一索引 (#23)
This commit is contained in:
parent
6e3ffa092b
commit
2c51b04381
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||||||
import com.tangzc.mpe.autotable.annotation.Column;
|
import com.tangzc.mpe.autotable.annotation.Column;
|
||||||
import com.tangzc.mpe.autotable.annotation.ColumnId;
|
import com.tangzc.mpe.autotable.annotation.ColumnId;
|
||||||
import com.tangzc.mpe.autotable.annotation.Table;
|
import com.tangzc.mpe.autotable.annotation.Table;
|
||||||
|
import com.tangzc.mpe.autotable.annotation.UniqueIndex;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@ -23,16 +24,21 @@ import lombok.NoArgsConstructor;
|
|||||||
public class User {
|
public class User {
|
||||||
@ColumnId(mode = IdType.AUTO, comment = "id主键")
|
@ColumnId(mode = IdType.AUTO, comment = "id主键")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
@UniqueIndex
|
||||||
@Column(comment = "学生id", notNull = true)
|
@Column(comment = "学生id", notNull = true)
|
||||||
private Integer studentId;
|
private Integer studentId;
|
||||||
|
@UniqueIndex
|
||||||
@Column(comment = "用户名", notNull = true)
|
@Column(comment = "用户名", notNull = true)
|
||||||
private String username;
|
private String username;
|
||||||
@Column(comment = "密码", notNull = true)
|
@Column(comment = "密码", notNull = true)
|
||||||
private String password;
|
private String password;
|
||||||
|
@UniqueIndex
|
||||||
@Column(comment = "邮箱", notNull = true)
|
@Column(comment = "邮箱", notNull = true)
|
||||||
private String email;
|
private String email;
|
||||||
|
@UniqueIndex
|
||||||
@Column(comment = "年级", notNull = true)
|
@Column(comment = "年级", notNull = true)
|
||||||
private String grade;
|
private String grade;
|
||||||
|
@UniqueIndex
|
||||||
@Column(comment = "用户所属团队", notNull = true)
|
@Column(comment = "用户所属团队", notNull = true)
|
||||||
private String userGroup;
|
private String userGroup;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user