a329d4906b
- 方案文档: AVCC 体系建设、IPTV TCS 需求(0-req)/PRD(1-prd)/任务(2-task)/二三四期任务 - tcs-iptv: Go 后端(哈希SDK/MA码生成/可信数据空间mock/业务编排/HTTP API+HMAC鉴权) - web-console: React+AntD 监管大屏(角色工作台/全流程演示/监管片库) - 一剧一码+集级哈希, 集级下架/恢复, 全栈测试通过
99 lines
3.5 KiB
Go
99 lines
3.5 KiB
Go
// Package model 定义 TCS-IPTV 的领域模型,
|
|
// 对应需求16的四类核心数据结构与 CTID 双锚定模型。
|
|
package model
|
|
|
|
import "time"
|
|
|
|
// Party 三方角色标识。
|
|
type Party string
|
|
|
|
const (
|
|
PartyCP Party = "cp" // 内容提供商
|
|
PartyReviewer Party = "reviewer" // 审核和监管部门(审核主体:CSPS/媒资库)
|
|
PartyOperator Party = "operator" // 运营商
|
|
)
|
|
|
|
// Content 内容主表(Content Registry)。
|
|
type Content struct {
|
|
ContentTwinID string `json:"content_twin_id"`
|
|
MACode string `json:"ma_code"`
|
|
MAType string `json:"ma_type"`
|
|
Title string `json:"title"`
|
|
EpisodeCount int `json:"episode_count"`
|
|
Status string `json:"status"`
|
|
Issuer string `json:"issuer"`
|
|
IssueDate string `json:"issue_date"`
|
|
FileHash string `json:"file_hash,omitempty"` // 传输便利:列表时附带整剧文件哈希(供运营商演示注入)
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
// HashType 哈希类型。
|
|
type HashType string
|
|
|
|
const (
|
|
HashFile HashType = "file_sha256"
|
|
HashPerceptual HashType = "perceptual"
|
|
HashTranscoded HashType = "transcoded"
|
|
)
|
|
|
|
// HashBinding 哈希绑定(Hash Binding)。
|
|
type HashBinding struct {
|
|
ContentTwinID string `json:"content_twin_id"`
|
|
HashType HashType `json:"hash_type"`
|
|
HashValue string `json:"hash_value"`
|
|
MerkleRoot string `json:"merkle_root"`
|
|
Episode int `json:"episode"` // 集号;0 表示整剧/单体(非分集)
|
|
FileFormat string `json:"file_format"`
|
|
Resolution string `json:"resolution"`
|
|
Duration int `json:"duration"`
|
|
Version string `json:"version"`
|
|
ParentHash string `json:"parent_hash"` // 转码版指向母版哈希
|
|
Revoked bool `json:"revoked"` // 集级下架标记(true=该集已下架)
|
|
RevokedReason string `json:"revoked_reason,omitempty"`
|
|
CreatedBy string `json:"created_by"`
|
|
}
|
|
|
|
// EpisodeHash 单集哈希(送审时按集提交)。
|
|
type EpisodeHash struct {
|
|
Episode int `json:"episode"`
|
|
FileSHA256 string `json:"file_sha256"`
|
|
MerkleRoot string `json:"merkle_root"`
|
|
Perceptual string `json:"perceptual_hash"`
|
|
Duration int `json:"duration"`
|
|
Resolution string `json:"resolution"`
|
|
}
|
|
|
|
// Mapping 三方编码映射(Identity Mapping)。
|
|
type Mapping struct {
|
|
ContentTwinID string `json:"content_twin_id"`
|
|
Party Party `json:"party"`
|
|
PartyID string `json:"party_id"`
|
|
PartyName string `json:"party_name"`
|
|
CDNEndpoint string `json:"cdn_endpoint"`
|
|
}
|
|
|
|
// VersionChange 版本变更(Version History)。
|
|
type VersionChange struct {
|
|
ContentTwinID string `json:"content_twin_id"`
|
|
Version string `json:"version"`
|
|
ChangeReason string `json:"change_reason"`
|
|
PrevHash string `json:"prev_hash"`
|
|
NewHash string `json:"new_hash"`
|
|
ReauditRequired bool `json:"reaudit_required"`
|
|
ReauditStatus string `json:"reaudit_status"`
|
|
AffectedEpisode int `json:"affected_episode"`
|
|
}
|
|
|
|
// 内容审核状态。
|
|
const (
|
|
StatusPending = "pending" // 待审
|
|
StatusPreChecking = "pre_checking" // 预检中
|
|
StatusReviewing = "reviewing" // CSPS 审核中
|
|
StatusApproved = "approved" // 审核通过(待发码)
|
|
StatusIssued = "issued" // 已发码(送审单完结)
|
|
StatusRejected = "rejected" // 驳回
|
|
StatusInLibrary = "in_library" // 已入媒资库
|
|
StatusPublished = "published" // 已发布
|
|
StatusRevoked = "revoked" // 已下架
|
|
)
|