feat: 更新CC码监管方案业务版文档,新增摘要、UGC专项、直播专项、存量处置、误判申诉、水印嵌入、CC码生命周期、组织保障等章节;同步macode到cccode重命名及其他代码变更

This commit is contained in:
freedakgmail
2026-07-20 22:25:40 +08:00
parent 9f1e2d0a21
commit eb4a82a877
76 changed files with 2600 additions and 2122 deletions
+13 -13
View File
@@ -11,7 +11,7 @@ import (
"github.com/tcs-iptv/tcs/internal/chain"
"github.com/tcs-iptv/tcs/internal/config"
"github.com/tcs-iptv/tcs/internal/httpx"
"github.com/tcs-iptv/tcs/internal/macode"
"github.com/tcs-iptv/tcs/internal/cccode"
"github.com/tcs-iptv/tcs/internal/monitor"
"github.com/tcs-iptv/tcs/internal/service"
)
@@ -29,13 +29,13 @@ func openDB(dsn string) *sql.DB {
}
// newAllocationStore 优先使用 PostgreSQL(持久、防重号),不可用时回退内存。
func newAllocationStore(db *sql.DB) macode.AllocationStore {
func newAllocationStore(db *sql.DB) cccode.AllocationStore {
if db != nil {
log.Printf("macode: 使用 PostgreSQL 号段存储")
return macode.NewPostgresStore(db)
log.Printf("cccode: 使用 PostgreSQL 号段存储")
return cccode.NewPostgresStore(db)
}
log.Printf("macode: PostgreSQL 不可用,回退内存号段存储(仅开发用)")
return macode.NewMemoryStore()
log.Printf("cccode: PostgreSQL 不可用,回退内存号段存储(仅开发用)")
return cccode.NewMemoryStore()
}
// newChain 按配置选择链后端:
@@ -76,20 +76,20 @@ func main() {
// 装配依赖:共享一个 PG 连接给链持久化与号段存储
db := openDB(cfg.PostgresDSN)
ch := newChain(cfg.ChainBackend, cfg.ChainMakerSDKConf, db)
gen := macode.NewGenerator(newAllocationStore(db))
gen := cccode.NewGenerator(newAllocationStore(db))
// 示例号段(生产由与发码机构对接后配置)
// 机构节点 6101 = 陕西(管理方:陕西IPTV运营公司);行业节点 8531 = IPTV视听内容
_ = gen.RegisterSegment(macode.Segment{
_ = gen.RegisterSegment(cccode.Segment{
IndustryNode: "8531", OrgNode: "6101",
Category: macode.CategoryMicroDrama, Start: 1, End: 9999999, SeqWidth: 7,
Category: cccode.CategoryMicroDrama, Start: 1, End: 9999999, SeqWidth: 7,
})
_ = gen.RegisterSegment(macode.Segment{
_ = gen.RegisterSegment(cccode.Segment{
IndustryNode: "8531", OrgNode: "6101",
Category: macode.CategoryWebSeries, Start: 1, End: 9999999, SeqWidth: 7,
Category: cccode.CategoryWebSeries, Start: 1, End: 9999999, SeqWidth: 7,
})
_ = gen.RegisterSegment(macode.Segment{
_ = gen.RegisterSegment(cccode.Segment{
IndustryNode: "8531", OrgNode: "6101",
Category: macode.CategoryWebMovie, Start: 1, End: 9999999, SeqWidth: 7,
Category: cccode.CategoryWebMovie, Start: 1, End: 9999999, SeqWidth: 7,
})
svc := service.New(ch, gen)
h := api.NewHandler(svc)