prompt/Java21_SpBoot3_Gen_Bean.md

1.7 KiB
Raw Blame History

根据SysUser为下面的表结构生成JavaBean你只需要生成一个JavaBean的内容即可以下是SysUser
@Getter
@Setter
@TableName(value = "t_sys_user")
public class SysUser implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @Schema(name = "id", description = "ID")
    private Long id;

    @Schema(name = "mobile", description = "手机号")
    @NotBlank
    @MustMobile
    @Length(max = 11)
    private String mobile;

    @Schema(name = "name", description = "姓名")
    @NotBlank
    @Length(max = 200)
    private String name;

    @Schema(name = "idCardNo", description = "身份证号")
    @MustIdCard
    private String idCardNo;

    @Schema(name = "password", description = "登录密码")
    @NotBlank
    @Password
    @Length(min = 8, max = 16)
    private String password;

    @Schema(name = "salt", description = "密钥salt")
    private String salt;

    @Email
    @Length(max = 200)
    @Schema(name = "email", description = "邮箱")
    private String email;

    @Schema(name = "gender", description = "性别 0=女,1=男")
    private Gender gender;

    @Schema(name = "state", description = Enable.DESC)
    private Enable state;

    @Schema(name = "createAt", description = "创建时间")
    private LocalDateTime createAt;

    @Schema(name = "updateAt", description = "变更时间")
    private LocalDateTime updateAt;

    @Schema(name = "createAtName", description = "创建人")
    private String createAtName;

    @Schema(name = "updateAtName", description = "变更人")
    private String updateAtName;

}
以上是SysUser以下是表结构