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-01 12:43:29 +08:00
|
|
|
|
UserID int32 `json:"user_id" gorm:"column:user_id"` // 用户ID
|
|
|
|
|
|
ResourceID int32 `json:"resource_id" gorm:"column:resource_id"` // 套餐ID
|
|
|
|
|
|
ProxyID int32 `json:"proxy_id" gorm:"column:proxy_id"` // 代理ID
|
|
|
|
|
|
BatchNo string `json:"batch_no" gorm:"column:batch_no"` // 批次编号
|
|
|
|
|
|
Port uint16 `json:"port" gorm:"column:port"` // 代理端口
|
|
|
|
|
|
EdgeID *int32 `json:"edge_id" gorm:"column:edge_id"` // 节点ID(手动配置)
|
|
|
|
|
|
FilterISP *EdgeISP `json:"filter_isp" gorm:"column:filter_isp"` // 运营商过滤(自动配置):参考 edge.isp
|
|
|
|
|
|
FilterProv *string `json:"filter_prov" gorm:"column:filter_prov"` // 省份过滤(自动配置)
|
|
|
|
|
|
FilterCity *string `json:"filter_city" gorm:"column:filter_city"` // 城市过滤(自动配置)
|
|
|
|
|
|
IP *orm.Inet `json:"ip" gorm:"column:ip"` // 节点地址
|
|
|
|
|
|
Whitelists *string `json:"whitelists" gorm:"column:whitelists"` // IP白名单,逗号分隔
|
|
|
|
|
|
Username *string `json:"username" gorm:"column:username"` // 用户名
|
|
|
|
|
|
Password *string `json:"password" gorm:"column:password"` // 密码
|
|
|
|
|
|
ExpiredAt time.Time `json:"expired_at" gorm:"column:expired_at"` // 过期时间
|
2025-11-24 18:44:06 +08:00
|
|
|
|
|
|
|
|
|
|
User User `json:"user" gorm:"foreignKey:UserID"`
|
|
|
|
|
|
Resource Resource `json:"resource" gorm:"foreignKey:ResourceID"`
|
|
|
|
|
|
Proxy Proxy `json:"proxy" gorm:"foreignKey:ProxyID"`
|
|
|
|
|
|
Edge *Edge `json:"edge" gorm:"foreignKey:EdgeID"`
|
|
|
|
|
|
}
|