2025-11-24 18:44:06 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"platform/web/core"
|
|
|
|
|
|
"platform/web/globals/orm"
|
|
|
|
|
|
"time"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// Channel 通道表
|
|
|
|
|
|
type Channel struct {
|
|
|
|
|
|
core.Model
|
2025-12-15 14:48:30 +08:00
|
|
|
|
UserID int32 `json:"user_id" gorm:"column:user_id"` // 用户ID
|
|
|
|
|
|
ResourceID int32 `json:"resource_id" gorm:"column:resource_id"` // 套餐ID
|
|
|
|
|
|
BatchNo string `json:"batch_no" gorm:"column:batch_no"` // 批次编号
|
|
|
|
|
|
ProxyID int32 `json:"proxy_id" gorm:"column:proxy_id"` // 代理ID
|
|
|
|
|
|
Host string `json:"host" gorm:"column:host"` // 代理主机
|
|
|
|
|
|
Port uint16 `json:"port" gorm:"column:port"` // 代理端口
|
|
|
|
|
|
EdgeID *int32 `json:"edge_id,omitempty" gorm:"column:edge_id"` // 节点ID(手动配置)
|
|
|
|
|
|
EdgeRef *string `json:"edge_ref,omitempty" gorm:"column:edge_ref"` // 外部节点引用,用于索引没有ID的外部非受控节点
|
|
|
|
|
|
FilterISP *EdgeISP `json:"filter_isp,omitempty" gorm:"column:filter_isp"` // 运营商过滤(自动配置):参考 edge.isp
|
|
|
|
|
|
FilterProv *string `json:"filter_prov,omitempty" gorm:"column:filter_prov"` // 省份过滤(自动配置)
|
|
|
|
|
|
FilterCity *string `json:"filter_city,omitempty" gorm:"column:filter_city"` // 城市过滤(自动配置)
|
|
|
|
|
|
IP *orm.Inet `json:"ip,omitempty" gorm:"column:ip"` // 节点地址
|
|
|
|
|
|
Whitelists *string `json:"whitelists,omitempty" gorm:"column:whitelists"` // IP白名单,逗号分隔
|
|
|
|
|
|
Username *string `json:"username,omitempty" gorm:"column:username"` // 用户名
|
|
|
|
|
|
Password *string `json:"password,omitempty" gorm:"column:password"` // 密码
|
|
|
|
|
|
ExpiredAt time.Time `json:"expired_at" gorm:"column:expired_at"` // 过期时间
|
2025-11-24 18:44:06 +08:00
|
|
|
|
|
2025-12-08 14:22:30 +08:00
|
|
|
|
User *User `json:"user,omitempty" gorm:"foreignKey:UserID"`
|
|
|
|
|
|
Resource *Resource `json:"resource,omitempty" gorm:"foreignKey:ResourceID"`
|
|
|
|
|
|
Proxy *Proxy `json:"proxy,omitempty" gorm:"foreignKey:ProxyID"`
|
|
|
|
|
|
Edge *Edge `json:"edge,omitempty" gorm:"foreignKey:EdgeID"`
|
2025-11-24 18:44:06 +08:00
|
|
|
|
}
|