四期(大小屏融合)后端可代码部分:跨域解析网关/扫码验真/跨屏权益通兑

- model/rights.go: ScreenType/ParsedMA/ResolveResult/ScanVerifyResult/UserRights/PurchaseRecord/CrossScreenRightsResult
- service/phase4.go: ParseMACode + Resolve(C.1/C.2) + ScanVerify(B.2) + RecordPurchase/VerifyCrossScreenRights(D.1)
- api/handlers.go: GET /content/resolve, POST /content/scan-verify, /rights/purchase, /rights/verify
- service/phase4_test.go: 18 单测全绿
- 同一MA码跨iptv/ott/app统一解析; 任一屏购买全屏通看不重复扣费
- OTT/移动端SDK/C2PA凭证标注需外部环境
- 更新 5-task-IPTV-四期.md 进度
This commit is contained in:
selfrelease
2026-06-14 19:01:26 +08:00
parent 959e5ac18e
commit 2cd5fbec6d
6 changed files with 590 additions and 13 deletions
+2
View File
@@ -57,6 +57,7 @@ type Service struct {
auths map[string]model.Authorization // maCode -> 授权(F22
black map[string]bool // maCode -> 黑名单(跨省复用校验)
filings map[string]model.FilingRecord // maCode -> 备案/网标关联(三期 A.1)
rights map[string]*model.UserRights // userHash -> 跨屏权益账户(四期 D.1)
mu sync.Mutex
seqMu sync.Mutex
seqs map[string]int // 按前缀独立计数(REV/ctid/DIST 各自从 1 递增)
@@ -87,6 +88,7 @@ func New(c chain.Client, gen *macode.Generator) *Service {
auths: make(map[string]model.Authorization),
black: make(map[string]bool),
filings: make(map[string]model.FilingRecord),
rights: make(map[string]*model.UserRights),
seqs: make(map[string]int), reviews: make(map[string]*reviewItem),
}
}