chore(docs): 移除 superpowers 设计与计划文档

This commit is contained in:
2026-09-03 13:20:00 +08:00
parent a52d66cd88
commit 136463f074
42 changed files with 1006 additions and 3729 deletions
+52 -56
View File
@@ -244,8 +244,7 @@ CREATE TABLE IF NOT EXISTS wallet_account (
user_name VARCHAR(64) NOT NULL DEFAULT '',
balance NUMERIC(15,2) NOT NULL DEFAULT 0,
currency VARCHAR(16) NOT NULL DEFAULT 'CNY',
status SMALLINT NOT NULL DEFAULT 1,
version BIGINT NOT NULL DEFAULT 1
status SMALLINT NOT NULL DEFAULT 1
);
-- 索引
@@ -267,7 +266,6 @@ COMMENT ON COLUMN wallet_account.user_name IS '用户名';
COMMENT ON COLUMN wallet_account.balance IS '可用余额(元,保留2位小数),可为负=欠费';
COMMENT ON COLUMN wallet_account.currency IS '货币类型:CNY-人民币';
COMMENT ON COLUMN wallet_account.status IS '状态:1启用/0禁用/-1冻结';
COMMENT ON COLUMN wallet_account.version IS '乐观锁版本号';
--------------------pgsql创建wallet_account表语句---------------------------
@@ -327,14 +325,14 @@ COMMENT ON COLUMN wallet_account_log.extra_data IS '额外数据(JSONB)';
--------------------pgsql创建wallet_account_log表语句---------------------------
--------------------pgsql创建pricing_config表语句---------------------------
--------------------pgsql创建wallet_pricing_config表语句---------------------------
-- 计价配置表(费率全 DB 配置,改价/加档只改 rules,代码不写死金额)
CREATE TABLE IF NOT EXISTS pricing_config (
CREATE TABLE IF NOT EXISTS wallet_pricing_config (
-- 基础字段(继承 SQLBaseCol 通用字段,与 SQLBaseDO 对齐)
id BIGINT PRIMARY KEY,
tenant_id BIGINT NOT NULL DEFAULT 0,
creator VARCHAR(64) NOT NULL,
id BIGINT PRIMARY KEY,
tenant_id BIGINT NOT NULL DEFAULT 0,
creator VARCHAR(64) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updater VARCHAR(64) NOT NULL,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -343,40 +341,38 @@ CREATE TABLE IF NOT EXISTS pricing_config (
-- 计价配置核心字段
subject_type VARCHAR(16) NOT NULL, -- workflow | model | business
subject_id VARCHAR(64) NOT NULL, -- workflow | 模型ID | 业务模块标识
rules TEXT NOT NULL, -- 费率JSON(见设计§4rules 自描述)
rules JSONB NOT NULL DEFAULT '{}', -- 费率JSON对象(见设计§4rules 自描述)
min_balance NUMERIC(15,2) NOT NULL DEFAULT 0,
currency VARCHAR(16) NOT NULL DEFAULT 'CNY',
enabled SMALLINT NOT NULL DEFAULT 1,
version BIGINT NOT NULL DEFAULT 1
);
enabled SMALLINT NOT NULL DEFAULT 1
);
-- 索引
CREATE UNIQUE INDEX IF NOT EXISTS uk_pricing_config_subject ON pricing_config(subject_type, subject_id);
CREATE INDEX IF NOT EXISTS idx_pricing_config_enabled ON pricing_config(enabled);
CREATE UNIQUE INDEX IF NOT EXISTS uk_pricing_config_subject ON wallet_pricing_config(subject_type, subject_id);
CREATE INDEX IF NOT EXISTS idx_pricing_config_enabled ON wallet_pricing_config(enabled);
-- 表和字段注释
COMMENT ON TABLE pricing_config IS '计价配置表(计价对象固定枚举,费率全 DB 配置)';
COMMENT ON COLUMN pricing_config.id IS '主键ID(非自增)';
COMMENT ON COLUMN pricing_config.tenant_id IS '租户ID';
COMMENT ON COLUMN pricing_config.creator IS '创建人';
COMMENT ON COLUMN pricing_config.created_at IS '创建时间';
COMMENT ON COLUMN pricing_config.updater IS '更新人';
COMMENT ON COLUMN pricing_config.updated_at IS '更新时间';
COMMENT ON COLUMN pricing_config.deleted_at IS '删除时间(软删)';
COMMENT ON COLUMN pricing_config.subject_type IS '计价对象类型:workflow/model/business';
COMMENT ON COLUMN pricing_config.subject_id IS '计价对象IDworkflow/模型ID/业务模块标识)';
COMMENT ON COLUMN pricing_config.rules IS '费率JSONworkflow三模式容器/model自适应/business周期)';
COMMENT ON COLUMN pricing_config.min_balance IS '门禁:调用前可用余额须>=该值(元),0=不校验';
COMMENT ON COLUMN pricing_config.currency IS '货币类型';
COMMENT ON COLUMN pricing_config.enabled IS '1启用 0停用';
COMMENT ON COLUMN pricing_config.version IS '乐观锁版本号';
COMMENT ON TABLE wallet_pricing_config IS '计价配置表(计价对象固定枚举,费率全 DB 配置)';
COMMENT ON COLUMN wallet_pricing_config.id IS '主键ID(非自增)';
COMMENT ON COLUMN wallet_pricing_config.tenant_id IS '租户ID';
COMMENT ON COLUMN wallet_pricing_config.creator IS '创建人';
COMMENT ON COLUMN wallet_pricing_config.created_at IS '创建时间';
COMMENT ON COLUMN wallet_pricing_config.updater IS '更新人';
COMMENT ON COLUMN wallet_pricing_config.updated_at IS '更新时间';
COMMENT ON COLUMN wallet_pricing_config.deleted_at IS '删除时间(软删)';
COMMENT ON COLUMN wallet_pricing_config.subject_type IS '计价对象类型:workflow/model/business';
COMMENT ON COLUMN wallet_pricing_config.subject_id IS '计价对象IDworkflow/模型ID/业务模块标识)';
COMMENT ON COLUMN wallet_pricing_config.rules IS '费率JSONworkflow三模式容器/model自适应/business周期)';
COMMENT ON COLUMN wallet_pricing_config.min_balance IS '门禁:调用前可用余额须>=该值(元),0=不校验';
COMMENT ON COLUMN wallet_pricing_config.currency IS '货币类型';
COMMENT ON COLUMN wallet_pricing_config.enabled IS '1启用 0停用';
--------------------pgsql创建pricing_config表语句---------------------------
--------------------pgsql创建wallet_pricing_config表语句---------------------------
--------------------pgsql创建charge_order表语句---------------------------
--------------------pgsql创建wallet_charge_order表语句---------------------------
-- 计费单表(一次计价调用 = 一张计费单,幂等键 subject_type + subject_id + biz_order_no
CREATE TABLE IF NOT EXISTS charge_order (
CREATE TABLE IF NOT EXISTS wallet_charge_order (
-- 基础字段(继承 SQLBaseCol 通用字段,与 SQLBaseDO 对齐)
id BIGINT PRIMARY KEY,
tenant_id BIGINT NOT NULL DEFAULT 0,
@@ -394,34 +390,34 @@ CREATE TABLE IF NOT EXISTS charge_order (
charge_mode VARCHAR(32) NOT NULL,
status SMALLINT NOT NULL DEFAULT 1,
actual_amount NUMERIC(15,2) NOT NULL DEFAULT 0,
usage TEXT NOT NULL DEFAULT '',
rule_snapshot TEXT NOT NULL DEFAULT '',
usage JSONB NOT NULL DEFAULT '{}',
rule_snapshot JSONB NOT NULL DEFAULT '{}',
settle_time TIMESTAMP
);
-- 索引
CREATE UNIQUE INDEX IF NOT EXISTS uk_charge_order_subject ON charge_order(subject_type, subject_id, biz_order_no);
CREATE INDEX IF NOT EXISTS idx_charge_order_user_id ON charge_order(user_id);
CREATE INDEX IF NOT EXISTS idx_charge_order_status ON charge_order(status);
CREATE UNIQUE INDEX IF NOT EXISTS uk_charge_order_subject ON wallet_charge_order(subject_type, subject_id, biz_order_no);
CREATE INDEX IF NOT EXISTS idx_charge_order_user_id ON wallet_charge_order(user_id);
CREATE INDEX IF NOT EXISTS idx_charge_order_status ON wallet_charge_order(status);
-- 表和字段注释
COMMENT ON TABLE charge_order IS '计费单表(一次计价调用 = 一张计费单)';
COMMENT ON COLUMN charge_order.id IS '主键ID(非自增)';
COMMENT ON COLUMN charge_order.tenant_id IS '租户ID';
COMMENT ON COLUMN charge_order.creator IS '创建人';
COMMENT ON COLUMN charge_order.created_at IS '创建时间';
COMMENT ON COLUMN charge_order.updater IS '更新人';
COMMENT ON COLUMN charge_order.updated_at IS '更新时间';
COMMENT ON COLUMN charge_order.deleted_at IS '删除时间(软删)';
COMMENT ON COLUMN charge_order.subject_type IS '计价对象类型';
COMMENT ON COLUMN charge_order.subject_id IS '计价对象ID';
COMMENT ON COLUMN charge_order.biz_order_no IS '业务单据号(幂等键,如工作流 execId)';
COMMENT ON COLUMN charge_order.user_id IS '扣费用户ID';
COMMENT ON COLUMN charge_order.charge_mode IS '计费方式(建单快照)';
COMMENT ON COLUMN charge_order.status IS '状态:1已建单 2已结算 3已失败';
COMMENT ON COLUMN charge_order.actual_amount IS '实收金额(元,保留2位小数)';
COMMENT ON COLUMN charge_order.usage IS '实际用量JSON';
COMMENT ON COLUMN charge_order.rule_snapshot IS '结算用费率快照JSON(防改价影响在途单)';
COMMENT ON COLUMN charge_order.settle_time IS '结算时间';
COMMENT ON TABLE wallet_charge_order IS '计费单表(一次计价调用 = 一张计费单)';
COMMENT ON COLUMN wallet_charge_order.id IS '主键ID(非自增)';
COMMENT ON COLUMN wallet_charge_order.tenant_id IS '租户ID';
COMMENT ON COLUMN wallet_charge_order.creator IS '创建人';
COMMENT ON COLUMN wallet_charge_order.created_at IS '创建时间';
COMMENT ON COLUMN wallet_charge_order.updater IS '更新人';
COMMENT ON COLUMN wallet_charge_order.updated_at IS '更新时间';
COMMENT ON COLUMN wallet_charge_order.deleted_at IS '删除时间(软删)';
COMMENT ON COLUMN wallet_charge_order.subject_type IS '计价对象类型';
COMMENT ON COLUMN wallet_charge_order.subject_id IS '计价对象ID';
COMMENT ON COLUMN wallet_charge_order.biz_order_no IS '业务单据号(幂等键,如工作流 execId)';
COMMENT ON COLUMN wallet_charge_order.user_id IS '扣费用户ID';
COMMENT ON COLUMN wallet_charge_order.charge_mode IS '计费方式(建单快照)';
COMMENT ON COLUMN wallet_charge_order.status IS '状态:1已建单 2已结算 3已失败';
COMMENT ON COLUMN wallet_charge_order.actual_amount IS '实收金额(元,保留2位小数)';
COMMENT ON COLUMN wallet_charge_order.usage IS '实际用量JSON';
COMMENT ON COLUMN wallet_charge_order.rule_snapshot IS '结算用费率快照JSON(防改价影响在途单)';
COMMENT ON COLUMN wallet_charge_order.settle_time IS '结算时间';
--------------------pgsql创建charge_order表语句---------------------------
--------------------pgsql创建wallet_charge_order表语句---------------------------