优化代码结构

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

@@ -0,0 +1,22 @@
package repo
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
}

15
server/fwd/repo/node.go Normal file
View File

@@ -0,0 +1,15 @@
package repo
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"`
}