23 lines
597 B
Go
23 lines
597 B
Go
package models
|
|
|
|
import (
|
|
"main/configs"
|
|
"time"
|
|
)
|
|
|
|
type Server struct {
|
|
ID int `json:"id" gorm:"primary_key"`
|
|
Name string `json:"name"`
|
|
Type string `json:"type"` // (訓練|推理)
|
|
IP string `json:"ip"`
|
|
Port int `json:"port"`
|
|
Username string `json:"username"`
|
|
Password string `json:"password"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"`
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"`
|
|
}
|
|
|
|
func init() {
|
|
configs.ORMDB().AutoMigrate(&Server{})
|
|
}
|