28 lines
1.3 KiB
Go
28 lines
1.3 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|qiniu|aliyun
|
||
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" }
|