Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
- 新增业务模块文档放入 `docs/`。
- 根目录不要新增零散业务 Markdown。
- 接口文档以 Controller 的 `@RequestMapping` 和方法映射为准。
- 表结构以 `src/main/resources/db/os-base-sysadmin-ddl.sql` 为准。
- 初始数据以 `src/main/resources/db/os-base-sysadmin-db.sql` 为准。
- 表结构以 `src/main/resources/db/migration/mysql/` 中的 Flyway 基线及版本迁移为准。
- 受控初始数据以 `src/main/resources/db/migration/mysql/` 中的 Flyway 基线及数据迁移为准。
- 新模块应在 `modules/` 下建立独立文档;历史模块文档可逐步从平铺文件迁入,但迁移时必须保留链接兼容性。
2 changes: 1 addition & 1 deletion docs/audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

## 数据表

表结构由 `src/main/resources/db/os-base-sysadmin-ddl.sql` 维护。
表结构由 `src/main/resources/db/migration/mysql/` 中的 Flyway 基线及版本迁移维护。

`base_sys_audit_log` 主要字段:

Expand Down
4 changes: 2 additions & 2 deletions docs/captcha.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
- `maxLimitCount`
- `enabled`

初始数据位于 `src/main/resources/db/os-base-sysadmin-db.sql`:
以下示例初始数据由 `src/main/resources/db/migration/mysql/dml/V20260920_01__dml_restore_legacy_controlled_seed_data.sql` 补齐:

- `LOGIN_IMAGE`
- `REGISTER_IMAGE`
Expand Down Expand Up @@ -105,6 +105,6 @@ captcha:

## 数据表

表结构由 `src/main/resources/db/os-base-sysadmin-ddl.sql` 维护:
表结构由 `src/main/resources/db/migration/mysql/` 中的 Flyway 基线及版本迁移维护:

- `base_sys_captcha_scene`
4 changes: 2 additions & 2 deletions docs/dict.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ Framework 侧异步注册失败不会阻止业务应用启动。

## 数据表

表结构由 `src/main/resources/db/os-base-sysadmin-ddl.sql` 维护:
表结构由 `src/main/resources/db/migration/mysql/` 中的 Flyway 基线及版本迁移维护:

- `base_sys_dict_type`
- `base_sys_dict_item`

初始数据由 `src/main/resources/db/os-base-sysadmin-db.sql` 维护,当前包含:
以下示例初始数据由 `src/main/resources/db/migration/mysql/dml/V20260920_01__dml_restore_legacy_controlled_seed_data.sql` 补齐,当前包含:

- `gender`
- `notice_level`
Expand Down
4 changes: 2 additions & 2 deletions docs/notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@

## 数据表

表结构由 `src/main/resources/db/os-base-sysadmin-ddl.sql` 维护:
表结构由 `src/main/resources/db/migration/mysql/` 中的 Flyway 基线及版本迁移维护:

- `base_sys_notification_scene`
- `base_sys_notification_template`
- `base_sys_notification_record`

初始数据由 `src/main/resources/db/os-base-sysadmin-db.sql` 维护:
以下示例初始数据由 `src/main/resources/db/migration/mysql/dml/V20260920_01__dml_restore_legacy_controlled_seed_data.sql` 补齐:

- 场景:`LOGIN_CAPTCHA`、`ORDER_CREATED`
- 模板:`NOTIFY_TPL_LOGIN_SMS`、`NOTIFY_TPL_LOGIN_EMAIL`、`NOTIFY_TPL_ORDER_SMS`、`NOTIFY_TPL_ORDER_EMAIL`
Expand Down
2 changes: 1 addition & 1 deletion docs/ratelimit.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@

## 数据表

表结构由 `src/main/resources/db/os-base-sysadmin-ddl.sql` 维护:
表结构由 `src/main/resources/db/migration/mysql/` 中的 Flyway 基线及版本迁移维护:

- `base_sys_ratelimit_scene`

Expand Down
2 changes: 2 additions & 0 deletions docs/superpowers/plans/2026-07-06-notification-center.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Notification Center Implementation Plan

> Historical plan: paths to `os-base-sysadmin-*.sql` below refer to retired manual initialization files. Current database changes belong in `src/main/resources/db/migration/mysql/`.

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Build database-managed notification scenes, channel templates, send records, and manual retry APIs in `base-sysadmin`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Captcha Notification Template Binding Implementation Plan

> Historical plan: paths to `os-base-sysadmin-*.sql` below refer to retired manual initialization files. Current database changes belong in `src/main/resources/db/migration/mysql/`.

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Bind captcha scenes directly to notification center templates so SMS and email captcha sends are fully database-managed.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
SET NAMES utf8mb4;

DROP DATABASE IF EXISTS os_base_sysadmin;
CREATE DATABASE os_base_sysadmin DEFAULT CHARSET utf8mb4;
USE os_base_sysadmin;

INSERT INTO `base_sys_captcha_scene` (`id`, `scene_code`, `scene_name`, `captcha_type`, `template_code`, `notification_template_id`, `description`, `captcha_length`, `captcha_expire_time`, `captcha_attempts`, `min_interval`, `max_limit_count`, `enabled`, `created_by`, `updated_by`)
-- Restore controlled seeds that were present only in the retired manual initialization script.
-- Existing records, including administrator customizations, are preserved.
INSERT IGNORE INTO `base_sys_captcha_scene` (`id`, `scene_code`, `scene_name`, `captcha_type`, `template_code`, `notification_template_id`, `description`, `captcha_length`, `captcha_expire_time`, `captcha_attempts`, `min_interval`, `max_limit_count`, `enabled`, `created_by`, `updated_by`)
VALUES
('LOGIN_IMAGE', 'LOGIN_IMAGE', '登录时图形验证码', 'IMAGE', NULL, NULL, '登录时图形验证码', 4, 300, 1, 60, 100, 1, 'system', 'system'),
('REGISTER_IMAGE', 'REGISTER_IMAGE', '注册时图形验证码', 'IMAGE', NULL, NULL, '注册时图形验证码', 4, 60, 3, 60, 50, 1, 'system', 'system'),
('LOGIN_SMS', 'LOGIN_SMS', '登录时短信验证码', 'SMS', 'CAPTCHA', 'NOTIFY_TPL_LOGIN_SMS', '登录时短信验证码', 6, 60, 2, 60, 100, 1, 'system', 'system'),
('LOGIN_EMAIL', 'LOGIN_EMAIL', '登录时邮箱验证码', 'EMAIL', 'CAPTCHA', 'NOTIFY_TPL_LOGIN_EMAIL', '登录时邮箱验证码', 6, 300, 3, 60, 100, 1, 'system', 'system');

INSERT INTO `base_sys_notification_scene` (`id`, `scene_code`, `scene_name`, `description`, `enabled`, `created_by`, `updated_by`)
INSERT IGNORE INTO `base_sys_notification_scene` (`id`, `scene_code`, `scene_name`, `description`, `enabled`, `created_by`, `updated_by`)
VALUES
('NOTIFY_SCENE_LOGIN_CAPTCHA', 'LOGIN_CAPTCHA', '登录验证码', '登录时发送验证码通知', 1, 'system', 'system'),
('NOTIFY_SCENE_ORDER_CREATED', 'ORDER_CREATED', '订单创建', '订单创建后发送通知', 1, 'system', 'system');

INSERT INTO `base_sys_notification_template` (`id`, `scene_code`, `channel`, `template_name`, `title`, `content`, `param_schema`, `sort`, `enabled`, `created_by`, `updated_by`)
INSERT IGNORE INTO `base_sys_notification_template` (`id`, `scene_code`, `channel`, `template_name`, `title`, `content`, `param_schema`, `sort`, `enabled`, `created_by`, `updated_by`)
VALUES
('NOTIFY_TPL_LOGIN_SMS', 'LOGIN_CAPTCHA', 'SMS', '登录验证码短信', NULL, '【通知】您的登录验证码为:{code},请在{minutes}分钟内使用。如非本人操作,请忽略本信息。', 'code:验证码; minutes:有效分钟数', 1, 1, 'system', 'system'),
('NOTIFY_TPL_LOGIN_EMAIL', 'LOGIN_CAPTCHA', 'EMAIL', '登录验证码邮件', '登录验证码', '您的登录验证码为:{code},请在{minutes}分钟内使用。', 'code:验证码; minutes:有效分钟数', 2, 1, 'system', 'system'),
('NOTIFY_TPL_ORDER_SMS', 'ORDER_CREATED', 'SMS', '订单创建短信', NULL, '【通知】您的订单{orderNo}已提交成功。', 'orderNo:订单号', 1, 1, 'system', 'system'),
('NOTIFY_TPL_ORDER_EMAIL', 'ORDER_CREATED', 'EMAIL', '订单创建邮件', '订单提交成功', '您的订单{orderNo}已提交成功,谢谢。', 'orderNo:订单号', 2, 1, 'system', 'system');

INSERT INTO `base_sys_dict_type` (`id`, `name`, `dict_code`, `status`, `remark`, `created_by`, `updated_by`)
INSERT IGNORE INTO `base_sys_dict_type` (`id`, `name`, `dict_code`, `status`, `remark`, `created_by`, `updated_by`)
VALUES
('DICT_GENDER', '性别', 'gender', 1, '用户性别', 'system', 'system'),
('DICT_NOTICE_LEVEL', '通知级别', 'notice_level', 1, '通知公告级别', 'system', 'system'),
('DICT_NOTICE_TYPE', '通知类型', 'notice_type', 1, '通知公告类型', 'system', 'system'),
('DICT_IQC_RULE_CATEGORY', 'IQC 规则分类', 'iqc_rule_category', 1, 'IQC 规则业务分类(管理员可维护)', 'system', 'system');
('DICT_NOTICE_TYPE', '通知类型', 'notice_type', 1, '通知公告类型', 'system', 'system');

INSERT INTO `base_sys_dict_item` (`id`, `dict_code`, `label`, `value`, `status`, `sort`, `tag_type`, `created_by`, `updated_by`)
INSERT IGNORE INTO `base_sys_dict_item` (`id`, `dict_code`, `label`, `value`, `status`, `sort`, `tag_type`, `created_by`, `updated_by`)
VALUES
('DICT_GENDER_M', 'gender', '男', 'M', 1, 1, 'P', 'system', 'system'),
('DICT_GENDER_F', 'gender', '女', 'F', 1, 2, 'D', 'system', 'system'),
Expand All @@ -43,10 +38,4 @@ VALUES
('DICT_NOTICE_TYPE_SECURITY', 'notice_type', '安全警告', 'SECURITY_WARNING', 1, 3, 'D', 'system', 'system'),
('DICT_NOTICE_TYPE_HOLIDAY', 'notice_type', '假期通知', 'HOLIDAY_NOTICE', 1, 4, 'S', 'system', 'system'),
('DICT_NOTICE_TYPE_NEWS', 'notice_type', '公司新闻', 'COMPANY_NEWS', 1, 5, 'P', 'system', 'system'),
('DICT_NOTICE_TYPE_OTHER', 'notice_type', '其他', 'OTHER', 1, 99, 'I', 'system', 'system'),
('DICT_IQC_RULE_CAT_SERVICE', 'iqc_rule_category', '服务质量', 'SERVICE_QUALITY', 1, 10, 'P', 'system', 'system'),
('DICT_IQC_RULE_CAT_COMPLIANCE', 'iqc_rule_category', '合规审查', 'COMPLIANCE', 1, 20, 'W', 'system', 'system'),
('DICT_IQC_RULE_CAT_SALES', 'iqc_rule_category', '销售规范', 'SALES', 1, 30, 'S', 'system', 'system'),
('DICT_IQC_RULE_CAT_RISK', 'iqc_rule_category', '风险控制', 'RISK_CONTROL', 1, 40, 'D', 'system', 'system'),
('DICT_IQC_RULE_CAT_PRIVACY', 'iqc_rule_category', '数据与隐私', 'DATA_PRIVACY', 1, 50, 'I', 'system', 'system'),
('DICT_IQC_RULE_CAT_CUSTOM', 'iqc_rule_category', '自定义', 'CUSTOM', 1, 99, 'N', 'system', 'system');
('DICT_NOTICE_TYPE_OTHER', 'notice_type', '其他', 'OTHER', 1, 99, 'I', 'system', 'system');
Loading
Loading