From c49434e36f293afdd23416e3bafc14eb9e59f500 Mon Sep 17 00:00:00 2001 From: 8ga Date: Sat, 21 Jun 2025 08:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Java21=5FSpBoot3=5FGen=5FB?= =?UTF-8?q?ean.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Java21_SpBoot3_Gen_Bean.md | 65 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Java21_SpBoot3_Gen_Bean.md diff --git a/Java21_SpBoot3_Gen_Bean.md b/Java21_SpBoot3_Gen_Bean.md new file mode 100644 index 0000000..2e5eb51 --- /dev/null +++ b/Java21_SpBoot3_Gen_Bean.md @@ -0,0 +1,65 @@ +``` +根据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,以下是表结构: + +``` \ No newline at end of file