A 层搬运(整包,源=poc-final 5e09a4cc): 协议四栈/pkg 标准件 12 包/util 计费纯函数/middleware/迁移链 repository·mysql v1~v19+clickhouse/model·entity/config/service·audit·balance/app/cmd·{migrate,reconcile,cmppbench}/tools·gen-dict/_bench/test·integration/openapi·yaml/监控三件/运维资产(compose+kind+CI 两套+Makefile+runbook)/scripts 种子/前端基建(根配置+src 基建目录,views 留 B 层)

This commit is contained in:
2026-11-13 15:16:01 +08:00
parent 2a6a66fbd3
commit e47610f4ed
273 changed files with 33973 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
-- ============================================================
-- go-sms RBAC 基础角色策略(参考脚本,Day 17)
-- 权威以 cmd/migrate v5_seed_rbac 为准;本文件供 DBA 评审。
-- 角色:admin/客户运维(ops)/客服(service)/集团(group)/客户(customer)
-- 模型:sub=角色;obj=资源;act=动作(* 通配);g=账户-角色绑定
-- ============================================================
CREATE TABLE IF NOT EXISTS `casbin_rule` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`ptype` VARCHAR(100) NOT NULL DEFAULT '',
`v0` VARCHAR(100) NOT NULL DEFAULT '',
`v1` VARCHAR(100) NOT NULL DEFAULT '',
`v2` VARCHAR(100) NOT NULL DEFAULT '',
`v3` VARCHAR(100) NOT NULL DEFAULT '',
`v4` VARCHAR(100) NOT NULL DEFAULT '',
`v5` VARCHAR(100) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `idx_casbin_rule` (`v0`,`v1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Casbin 策略';
INSERT IGNORE INTO `casbin_rule` (`ptype`,`v0`,`v1`,`v2`) VALUES
('p','admin','*','*'),
('p','ops','*','read'),
('p','ops','account','write'),
('p','ops','channel','write'),
('p','ops','message','write'),
('p','ops','audit','write'),
('p','service','account','read'),
('p','service','message','read'),
('p','service','stats','read'),
('p','group','account','read'),
('p','group','message','write'),
('p','customer','message','write'),
('p','customer','stats','read'),
('g','1','admin','');