粉丝表添加父节点的信息

This commit is contained in:
2026-06-03 18:00:37 +08:00
parent 7b3879d6b6
commit 4cf8122659
4 changed files with 37 additions and 0 deletions

View File

@@ -52,6 +52,22 @@ public class LbFanManagement implements Serializable {
@Schema(description = "手机号") @Schema(description = "手机号")
private String mobile; private String mobile;
@TableField("p_name")
@Schema(description = "父姓名")
private String pName;
@TableField("pid")
@Schema(description = "父ID")
private Long pid;
@TableField("p_phone")
@Schema(description = "父手机号")
private String pPhone;
@TableField("token")
@Schema(description = "登录 token")
private String token;
@TableField("created_at") @TableField("created_at")
@Schema(description = "创建时间") @Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

View File

@@ -387,6 +387,15 @@ public class LbFanManagementServiceImpl
if (entity.getMobile() != null) { if (entity.getMobile() != null) {
entity.setMobile(entity.getMobile().trim()); entity.setMobile(entity.getMobile().trim());
} }
if (entity.getPName() != null) {
entity.setPName(entity.getPName().trim());
}
if (entity.getPPhone() != null) {
entity.setPPhone(entity.getPPhone().trim());
}
if (entity.getToken() != null) {
entity.setToken(entity.getToken().trim());
}
} }
private LocalDateTime parseDateTime(String text) { private LocalDateTime parseDateTime(String text) {

View File

@@ -9,6 +9,10 @@ CREATE TABLE `lb_fan_management` (
`avatar` VARCHAR(512) NULL DEFAULT NULL COMMENT '头像路径', `avatar` VARCHAR(512) NULL DEFAULT NULL COMMENT '头像路径',
`nickname` VARCHAR(100) NULL DEFAULT NULL COMMENT '昵称(可为脱敏手机号,如 137****6199', `nickname` VARCHAR(100) NULL DEFAULT NULL COMMENT '昵称(可为脱敏手机号,如 137****6199',
`mobile` VARCHAR(32) NULL DEFAULT NULL COMMENT '手机号', `mobile` VARCHAR(32) NULL DEFAULT NULL COMMENT '手机号',
`p_name` VARCHAR(100) NULL DEFAULT NULL COMMENT '父姓名',
`pid` BIGINT NULL DEFAULT NULL COMMENT '父ID',
`p_phone` VARCHAR(32) NULL DEFAULT NULL COMMENT '父手机号',
`token` VARCHAR(512) NULL DEFAULT NULL COMMENT '登录 token',
`created_at` DATETIME NULL DEFAULT NULL COMMENT '创建时间', `created_at` DATETIME NULL DEFAULT NULL COMMENT '创建时间',
`share_num` INT NOT NULL DEFAULT 0 COMMENT '分享次数', `share_num` INT NOT NULL DEFAULT 0 COMMENT '分享次数',
PRIMARY KEY (`id_tenant_id`) USING BTREE, PRIMARY KEY (`id_tenant_id`) USING BTREE,

View File

@@ -0,0 +1,8 @@
-- 升级脚本lb_fan_management 增加父级信息与 token 列
SET NAMES utf8mb4;
ALTER TABLE `lb_fan_management`
ADD COLUMN `p_name` VARCHAR(100) NULL DEFAULT NULL COMMENT '父姓名' AFTER `mobile`,
ADD COLUMN `pid` BIGINT NULL DEFAULT NULL COMMENT '父ID' AFTER `p_name`,
ADD COLUMN `p_phone` VARCHAR(32) NULL DEFAULT NULL COMMENT '父手机号' AFTER `pid`,
ADD COLUMN `token` VARCHAR(512) NULL DEFAULT NULL COMMENT '登录 token' AFTER `p_phone`;