CREATE TABLE `closet_shares` ( `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID', `created_at` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间', `updated_at` BIGINT NOT NULL DEFAULT 0 COMMENT '更新时间', `deleted_at` BIGINT NOT NULL DEFAULT 0 COMMENT '删除时间(0 表示未删除)', `created_by` BIGINT NOT NULL DEFAULT 0 COMMENT '创建人', `updated_by` BIGINT NOT NULL DEFAULT 0 COMMENT '更新人', `deleted_by` BIGINT NOT NULL DEFAULT 0 COMMENT '删除人', `share_uuid` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '分享UUID', `user_id` BIGINT NOT NULL DEFAULT 0 COMMENT '所属用户ID', `share_type` TINYINT NOT NULL DEFAULT 0 COMMENT '分享类型 1=部分衣物分享 2=全量快照分享', `expire_time` BIGINT NOT NULL DEFAULT 0 COMMENT '过期时间', `status` TINYINT NOT NULL DEFAULT 0 COMMENT '分享状态 1=正常 2=用户取消 3=已过期 4=管理员封禁', PRIMARY KEY (`id`), UNIQUE KEY `uk_closet_shares_uuid` (`share_uuid`), KEY `idx_closet_shares_user_status` (`user_id`, `status`) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '衣柜分享表'; CREATE TABLE `closet_share_items` ( `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID', `created_at` BIGINT NOT NULL DEFAULT 0 COMMENT '创建时间', `updated_at` BIGINT NOT NULL DEFAULT 0 COMMENT '更新时间', `deleted_at` BIGINT NOT NULL DEFAULT 0 COMMENT '删除时间(0 表示未删除)', `created_by` BIGINT NOT NULL DEFAULT 0 COMMENT '创建人', `updated_by` BIGINT NOT NULL DEFAULT 0 COMMENT '更新人', `deleted_by` BIGINT NOT NULL DEFAULT 0 COMMENT '删除人', `share_uuid` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '分享UUID', `clothes_id` BIGINT NOT NULL DEFAULT 0 COMMENT '衣物ID', PRIMARY KEY (`id`), KEY `idx_closet_share_items_share` (`share_uuid`) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '衣柜分享明细表';