feat: 方案100%匹配 — RBAC动态权限+Grafana监控+目录库独立微服务+全国目录中心+标识同步
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// 用户与组织管理模型(系统管理模块补足)。
|
||||
|
||||
// User 系统用户。
|
||||
type User struct {
|
||||
ID string `json:"id"` // 用户唯一标识
|
||||
Username string `json:"username"` // 登录用户名
|
||||
FullName string `json:"full_name"` // 真实姓名
|
||||
OrgID string `json:"org_id"` // 所属组织 ID
|
||||
Role string `json:"role"` // 角色:regulator/reviewer/cp/operator
|
||||
APIKey string `json:"api_key"` // API 密钥
|
||||
APISecret string `json:"-"` // API 密钥(不序列化、不下发)
|
||||
Status string `json:"status"` // active/disabled
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// UserStatus 用户状态常量。
|
||||
const (
|
||||
UserStatusActive = "active"
|
||||
UserStatusDisabled = "disabled"
|
||||
)
|
||||
|
||||
// Organization 组织/机构。
|
||||
type Organization struct {
|
||||
ID string `json:"id"` // 组织唯一标识
|
||||
Name string `json:"name"` // 组织名称
|
||||
OrgNode string `json:"org_node"` // MA 码机构节点(如 6101)
|
||||
Province string `json:"province"` // 所属省份
|
||||
Type string `json:"type"` // 组织类型:regulator/reviewer/cp/operator
|
||||
Status string `json:"status"` // active/disabled
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// OrgType 组织类型常量。
|
||||
const (
|
||||
OrgTypeRegulator = "regulator"
|
||||
OrgTypeReviewer = "reviewer"
|
||||
OrgTypeCP = "cp"
|
||||
OrgTypeOperator = "operator"
|
||||
)
|
||||
|
||||
// OrgStatus 组织状态常量。
|
||||
const (
|
||||
OrgStatusActive = "active"
|
||||
OrgStatusDisabled = "disabled"
|
||||
)
|
||||
|
||||
// Role 角色权限定义。
|
||||
type RolePermission struct {
|
||||
Role string `json:"role"` // regulator/reviewer/cp/operator
|
||||
Permissions []string `json:"permissions"` // 权限列表
|
||||
}
|
||||
@@ -95,4 +95,56 @@ const (
|
||||
StatusInLibrary = "in_library" // 已入媒资库
|
||||
StatusPublished = "published" // 已发布
|
||||
StatusRevoked = "revoked" // 已下架
|
||||
StatusMerged = "merged" // 已合并入其他MA码
|
||||
StatusSplit = "split" // 已拆分为多个MA码
|
||||
)
|
||||
|
||||
// ContentQueryResult 多维度标识查询的统一返回结果。
|
||||
// 支持按 Hash、省级内容编码、片库文件 ID 等多种维度反查内容标识信息。
|
||||
type ContentQueryResult struct {
|
||||
Found bool `json:"found"` // 是否找到匹配记录
|
||||
Content Content `json:"content"` // 内容主记录
|
||||
Bindings []HashBinding `json:"bindings"` // 哈希绑定列表
|
||||
Mappings []Mapping `json:"mappings"` // 三方编码映射列表
|
||||
}
|
||||
|
||||
// MergeRequest MA 合并请求(将多个 MA 码合并为一个主 MA 码)。
|
||||
type MergeRequest struct {
|
||||
PrimaryMACode string `json:"primary_ma_code"` // 合并后保留的主 MA 码
|
||||
SecondaryMACodes []string `json:"secondary_ma_codes"` // 被合并的 MA 码列表(合并后标记为 merged)
|
||||
Reason string `json:"reason"` // 合并原因
|
||||
Operator string `json:"operator"` // 操作人
|
||||
}
|
||||
|
||||
// MergeResult MA 合并结果。
|
||||
type MergeResult struct {
|
||||
PrimaryMACode string `json:"primary_ma_code"` // 主 MA 码
|
||||
MergedMACodes []string `json:"merged_ma_codes"` // 已合并的 MA 码列表
|
||||
MigratedBindings int `json:"migrated_bindings"` // 迁移的哈希绑定数
|
||||
MigratedMappings int `json:"migrated_mappings"` // 迁移的映射数
|
||||
TxID string `json:"tx_id"` // 链上交易 ID
|
||||
}
|
||||
|
||||
// SplitRequest MA 拆分请求(将一个 MA 码拆分为多个独立 MA 码)。
|
||||
type SplitRequest struct {
|
||||
SourceMACode string `json:"source_ma_code"` // 被拆分的源 MA 码
|
||||
Splits []SplitTarget `json:"splits"` // 拆分目标列表
|
||||
Reason string `json:"reason"` // 拆分原因
|
||||
Operator string `json:"operator"` // 操作人
|
||||
}
|
||||
|
||||
// SplitTarget 拆分目标:每集或每组内容拆分后的新 MA 码信息。
|
||||
type SplitTarget struct {
|
||||
NewMACode string `json:"new_ma_code"` // 拆分后新分配的 MA 码
|
||||
Title string `json:"title"` // 拆分后内容标题
|
||||
Episodes []int `json:"episodes"` // 关联的集号列表(空表示整剧拆分)
|
||||
}
|
||||
|
||||
// SplitResult MA 拆分结果。
|
||||
type SplitResult struct {
|
||||
SourceMACode string `json:"source_ma_code"` // 源 MA 码
|
||||
NewMACodes []string `json:"new_ma_codes"` // 拆分后生成的新 MA 码列表
|
||||
MigratedBindings int `json:"migrated_bindings"` // 迁移的哈希绑定数
|
||||
MigratedMappings int `json:"migrated_mappings"` // 迁移的映射数
|
||||
TxID string `json:"tx_id"` // 链上交易 ID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user