添加在线调试 api

This commit is contained in:
2025-03-08 10:59:31 +08:00
parent 053041ae34
commit 5786ac9d99
28 changed files with 236 additions and 539 deletions

View File

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

15
server/pkg/models/node.go Normal file
View File

@@ -0,0 +1,15 @@
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

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

14
server/pkg/models/user.go Normal file
View File

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