27 lines
1.5 KiB
Go
27 lines
1.5 KiB
Go
package entity
|
|
|
|
import "time"
|
|
|
|
// LongSmsPending 入向长短信挂起组(Day 71:聚合等待窗 10s→72h+不齐不发挂起制)。
|
|
// 一行=一封未收齐的长短信(grouper 首片 INSERT/续片 UPDATE/到齐 DELETE);
|
|
// 72h 扫描器(longsms_reaper)扫 expire_at 到期行:不齐→失败终态(task LP+组ID/
|
|
// detail id=组ID/UNDELIV 回执);齐(删行失败兜底)→补 merged(detail 存在性防重)。
|
|
// 进程重启 restore 全量回内存(grouper 持续等片,72h 内补齐仍可正常受理)。
|
|
// Frags 为 {"idx":"文本"} JSON(锁内序列化全量替换,同组片串行到达无并发写)。
|
|
type LongSmsPending struct {
|
|
GroupID uint64 `gorm:"primaryKey" json:"group_id"` // 组ID=首片雪花(N 片 Resp/失败 detail 复用)
|
|
AccountID int64 `json:"account_id"`
|
|
Username string `gorm:"size:64" json:"username"` // source_addr(auth 快照;restore 重载)
|
|
SrcID string `gorm:"size:32" json:"src_id"`
|
|
Mobile string `gorm:"size:20" json:"mobile"`
|
|
ExtCode string `gorm:"size:32" json:"ext_code"`
|
|
Ref uint8 `json:"ref"` // 组键 ref(restore 组键还原)
|
|
Total uint8 `json:"total"` // 客户端 pk_total
|
|
Ucs2 bool `json:"ucs2"` // Day 70:首片 MsgFmt 快照(计费口径)
|
|
Frags string `gorm:"type:text" json:"frags"`
|
|
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
|
ExpireAt time.Time `gorm:"index:idx_lsp_expire" json:"expire_at"` // created+window
|
|
}
|
|
|
|
func (LongSmsPending) TableName() string { return "longsms_pending" }
|