Files

17 lines
845 B
Go

package entity
import "time"
// UplinkCode 上行码号分配(Day 49 · A-4.18):码号→账号映射,
// match_type 精确/前缀两级匹配(精确优先,前缀取最长),未匹配上行归 admin。
type UplinkCode struct {
ID int64 `gorm:"primaryKey;autoIncrement" json:"id"`
AccountID int64 `gorm:"index:idx_uplink_account_time,priority:1;not null" json:"account_id"`
Code string `gorm:"size:32;index:idx_code,priority:1;not null" json:"code"` // 码号(精确码全串/前缀码前段)
MatchType int8 `gorm:"default:1" json:"match_type"` // 1精确 2前缀
Remark string `gorm:"size:255" json:"remark"`
CreatedAt time.Time `gorm:"autoCreateTime;index:idx_uplink_account_time,priority:2" json:"created_at"`
}
func (UplinkCode) TableName() string { return "uplink_code" }