优化代码结构

This commit is contained in:
2025-05-12 15:13:48 +08:00
parent 8bab6291b1
commit 536f36ae02
11 changed files with 45 additions and 182 deletions

View File

@@ -1,22 +0,0 @@
package models
import (
"time"
"gorm.io/gorm"
)
// Channel 连接认证模型
type Channel struct {
gorm.Model
UserId uint
NodeId uint
UserAddr string
NodePort int
AuthIp bool
AuthPass bool
Protocol string
Username string
Password string
Expiration time.Time
}

View File

@@ -1,15 +0,0 @@
package models
import "gorm.io/gorm"
// Node 客户端模型
type Node struct {
gorm.Model
Name string
Version byte
FwdPort uint16
Provider string
Location string
Channels []Channel `gorm:"foreignKey:NodeId"`
}

View File

@@ -1,9 +0,0 @@
package models
import "gorm.io/gorm"
type UserIp struct {
gorm.Model
UserId uint
IpAddress string
}

View File

@@ -1,14 +0,0 @@
package models
import "gorm.io/gorm"
type User struct {
gorm.Model
Password string
Username string
Email string
Phone string
Name string
Channels []Channel `gorm:"foreignKey:UserId"`
}