Files
mp-java/docs/app_config.sql
赵忠林 3ea8e652bd feat(app): 添加应用配置管理功能
- 创建应用配置表及实体类
- 实现应用配置的增删改查接口
- 添加配置值加密解密功能
- 支持按应用ID批量获取配置映射
- 实现配置的批量保存和删除功能
- 添加分页查询和列表查询支持
- 集成租户隔离和软删除功能
2026-03-30 19:42:53 +08:00

20 lines
1.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 应用配置表
CREATE TABLE app_config (
config_id INT PRIMARY KEY AUTO_INCREMENT COMMENT '配置ID',
website_id INT NOT NULL COMMENT '应用ID',
config_key VARCHAR(100) NOT NULL COMMENT '配置键',
config_value TEXT NOT NULL COMMENT '配置值JSON或字符串',
config_type VARCHAR(50) NOT NULL DEFAULT 'general' COMMENT '配置类型general/api/callback/wechat/payment/git等',
is_encrypted TINYINT DEFAULT 0 COMMENT '是否加密 0否 1是',
is_secret TINYINT DEFAULT 0 COMMENT '是否敏感信息 0否 1是',
description VARCHAR(500) DEFAULT '' COMMENT '配置说明',
sort_number INT DEFAULT 0 COMMENT '排序号',
tenant_id BIGINT NOT NULL DEFAULT 0 COMMENT '租户id',
created_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
updated_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
deleted TINYINT DEFAULT 0 COMMENT '是否删除 0否 1是',
UNIQUE KEY uk_website_key (website_id, config_key, deleted),
INDEX idx_website_type (website_id, config_type),
INDEX idx_tenant (tenant_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用配置表';