2025-11-24 18:44:06 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"platform/web/core"
|
|
|
|
|
|
"platform/web/globals/orm"
|
|
|
|
|
|
|
|
|
|
|
|
"gorm.io/datatypes"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// Proxy 代理服务表
|
|
|
|
|
|
type Proxy struct {
|
|
|
|
|
|
core.Model
|
2025-12-15 14:48:30 +08:00
|
|
|
|
Version int32 `json:"version" gorm:"column:version"` // 代理服务版本
|
|
|
|
|
|
Mac string `json:"mac" gorm:"column:mac"` // 代理服务名称
|
|
|
|
|
|
IP orm.Inet `json:"ip" gorm:"column:ip;not null"` // 代理服务地址
|
|
|
|
|
|
Host *string `json:"host,omitempty" gorm:"column:host"` // 代理服务域名
|
|
|
|
|
|
Secret *string `json:"secret,omitempty" gorm:"column:secret"` // 代理服务密钥
|
|
|
|
|
|
Type ProxyType `json:"type" gorm:"column:type"` // 代理服务类型:1-自有,2-白银
|
|
|
|
|
|
Status ProxyStatus `json:"status" gorm:"column:status"` // 代理服务状态:0-离线,1-在线
|
|
|
|
|
|
Meta *datatypes.JSONType[any] `json:"meta,omitempty" gorm:"column:meta"` // 代理服务元信息
|
2025-11-24 18:44:06 +08:00
|
|
|
|
|
2025-12-08 14:22:30 +08:00
|
|
|
|
Channels []Channel `json:"channels,omitempty" gorm:"foreignkey:ProxyID"`
|
2025-11-24 18:44:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ProxyType 代理服务类型枚举
|
|
|
|
|
|
type ProxyType int
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
|
ProxyTypeSelfHosted ProxyType = 1 // 自有
|
|
|
|
|
|
ProxyTypeBaiYin ProxyType = 2 // 白银
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// ProxyStatus 代理服务状态枚举
|
|
|
|
|
|
type ProxyStatus int
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
|
ProxyStatusOffline ProxyStatus = 0 // 离线
|
|
|
|
|
|
ProxyStatusOnline ProxyStatus = 1 // 在线
|
|
|
|
|
|
)
|