From eaa55862114dd05cc6e3fb3b6acc6a83306bab4d Mon Sep 17 00:00:00 2001 From: Hanserwei <2628273921@qq.com> Date: Sat, 11 Oct 2025 23:31:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(sql):=20=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E9=A2=91=E9=81=93=E3=80=81=E8=AF=9D=E9=A2=98=E5=8F=8A=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 leaf-segment 分布式ID配置表及初始数据 fix(pom):修正模块 artifactId 命名 - 将 han-note-api 模块名称更正为 han-note-note-api --- .idea/inspectionProfiles/Project_Default.xml | 1 + han-note-note/han-note-note-api/pom.xml | 2 +- sql/createData.sql | 18 ++++++++++++------ sql/leafcreatetable.sql | 17 +++++++++++++++++ 4 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 sql/leafcreatetable.sql diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 6a3a249..94be324 100755 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -15,5 +15,6 @@ + \ No newline at end of file diff --git a/han-note-note/han-note-note-api/pom.xml b/han-note-note/han-note-note-api/pom.xml index 19bad48..d300198 100644 --- a/han-note-note/han-note-note-api/pom.xml +++ b/han-note-note/han-note-note-api/pom.xml @@ -11,7 +11,7 @@ jar - han-note-api + han-note-note-api ${project.artifactId} RPC层, 供其他服务调用 diff --git a/sql/createData.sql b/sql/createData.sql index 649faf2..0e17d6f 100644 --- a/sql/createData.sql +++ b/sql/createData.sql @@ -16,11 +16,17 @@ VALUES (1, 1, 1, now(), now(), b'0'); INSERT INTO `t_role_permission_rel` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `is_deleted`) VALUES (2, 1, 2, now(), now(), b'0'); -INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('美食', now(), now(), 0); -INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('娱乐', now(), now(), 0); +INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`) +VALUES ('美食', now(), now(), 0); +INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`) +VALUES ('娱乐', now(), now(), 0); -INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('高分美剧推荐', now(), now(), 0); -INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('下饭综艺推荐', now(), now(), 0); +INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`) +VALUES ('高分美剧推荐', now(), now(), 0); +INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`) +VALUES ('下饭综艺推荐', now(), now(), 0); -INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`) VALUES (2, 1, now(), now()); -INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`) VALUES (2, 2, now(), now()); +INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`) +VALUES (2, 1, now(), now()); +INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`) +VALUES (2, 2, now(), now()); diff --git a/sql/leafcreatetable.sql b/sql/leafcreatetable.sql new file mode 100644 index 0000000..dbcfc60 --- /dev/null +++ b/sql/leafcreatetable.sql @@ -0,0 +1,17 @@ +INSERT INTO `leaf`.`leaf` (`biz_tag`, `max_id`, `step`, `description`, `update_time`) +VALUES ('leaf-segment-hannote-id', 10100, 2000, '小憨书 ID', now()); + +INSERT INTO `leaf`.`leaf` (`biz_tag`, `max_id`, `step`, `description`, `update_time`) +VALUES ('leaf-segment-user-id', 100, 2000, '用户 ID', now()); + +CREATE TABLE `leaf` +( + `biz_tag` varchar(128) NOT NULL DEFAULT '', + `max_id` bigint(20) NOT NULL DEFAULT '1', + `step` int(11) NOT NULL, + `description` varchar(256) DEFAULT NULL, + `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`biz_tag`) +) ENGINE = InnoDB; + +