| | |
| | | package models |
| | | |
| | | import "time" |
| | | |
| | | type SubPlatform struct { |
| | | Id string `gorm:"primary_key;" json:"id"` |
| | | HeartbeatTime string `gorm:"column:heartbeat_time" json:"heartbeat_time"` |
| | | Name string `gorm:"not null;default:''" json:"name"` |
| | | UserName string `gorm:"not null;default:''" json:"user_name"` |
| | | Realm string `gorm:"not null;default:''" json:"realm"` |
| | |
| | | Description string `gorm:"not null;default:''" json:"description"` |
| | | RemoteIP string `gorm:"not null;default:''" json:"remote_ip"` |
| | | RemotePort int `gorm:"not null;default:0" json:"remote_port"` |
| | | HeartbeatTime string `gorm:"column:heartbeat_time" json:"heartbeat_time"` |
| | | CreateTime int64 `gorm:"column:create_time;autoCreateTime;" json:"create_time"` |
| | | UpdateTime int64 `gorm:"column:update_time;autoUpdateTime" json:"-"` |
| | | DeleteTime int64 `gorm:"column:delete_time" json:"-"` |
| | |
| | | |
| | | return list, nil |
| | | } |
| | | |
| | | func (s *SubPlatform) Keepalive(id string) error { |
| | | return db.Table(s.TableName()).Where("id = ?", id).Update("heartbeat_time", time.Now().Format("2006-01-02 15:04:05")).Error |
| | | } |