init commit

This commit is contained in:
2025-02-19 14:23:58 +08:00
commit 10a4f010ce
34 changed files with 1340 additions and 0 deletions

View File

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

View File

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

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"`
}