29 lines
1.4 KiB
Go
29 lines
1.4 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
// ConnectionProfile 连接配置模型(SQLite 持久化)
|
|
type ConnectionProfile struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Name string `gorm:"type:varchar(100);not null" json:"name"`
|
|
Host string `gorm:"type:varchar(255)" json:"host"`
|
|
Port int `gorm:"default:22" json:"port"`
|
|
Username string `gorm:"type:varchar(100);default:root" json:"username"`
|
|
Password string `gorm:"type:text" json:"password"`
|
|
KeyPath string `gorm:"type:text" json:"key_path"`
|
|
Type string `gorm:"type:varchar(20);not null;index" json:"type"` // local|remote|sftp|oss
|
|
Provider string `gorm:"type:varchar(20)" json:"provider"` // qiniu|aliyun (仅 type=oss)
|
|
Token string `gorm:"type:text" json:"token"`
|
|
AccessKey string `gorm:"type:text" json:"access_key"`
|
|
SecretKey string `gorm:"type:text" json:"secret_key"`
|
|
Bucket string `gorm:"type:varchar(100)" json:"bucket"`
|
|
Region string `gorm:"type:varchar(100)" json:"region"`
|
|
Endpoint string `gorm:"type:varchar(255)" json:"endpoint"`
|
|
LastConnected *time.Time `json:"last_connected"`
|
|
SortOrder int `gorm:"default:0" json:"sort_order"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
func (ConnectionProfile) TableName() string { return "connection_profiles" }
|