mirror of
https://github.com/veops/oneterm.git
synced 2025-10-08 08:40:07 +08:00
59 lines
1.7 KiB
Go
59 lines
1.7 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/plugin/soft_delete"
|
|
)
|
|
|
|
type Gateway struct {
|
|
Id int `json:"id" gorm:"column:id;primarykey"`
|
|
Name string `json:"name" gorm:"column:name"`
|
|
Host string `json:"host" gorm:"column:host"`
|
|
Port int `json:"port" gorm:"column:port"`
|
|
AccountType int `json:"account_type" gorm:"column:account_type"`
|
|
Account string `json:"account" gorm:"column:account"`
|
|
Password string `json:"password" gorm:"column:password"`
|
|
Pk string `json:"pk" gorm:"column:pk"`
|
|
Phrase string `json:"phrase" gorm:"column:phrase"`
|
|
|
|
ResourceId int `json:"resource_id" gorm:"column:resource_id"`
|
|
CreatorId int `json:"creator_id" gorm:"column:creator_id"`
|
|
UpdaterId int `json:"updater_id" gorm:"column:updater_id"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"column:created_at"`
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"`
|
|
DeletedAt soft_delete.DeletedAt `json:"-" gorm:"column:deleted_at"`
|
|
|
|
AssetCount int64 `json:"asset_count" gorm:"-"`
|
|
}
|
|
|
|
func (m *Gateway) TableName() string {
|
|
return "gateway"
|
|
}
|
|
func (m *Gateway) SetId(id int) {
|
|
m.Id = id
|
|
}
|
|
func (m *Gateway) SetCreatorId(creatorId int) {
|
|
m.CreatorId = creatorId
|
|
}
|
|
func (m *Gateway) SetUpdaterId(updaterId int) {
|
|
m.UpdaterId = updaterId
|
|
}
|
|
func (m *Gateway) SetResourceId(resourceId int) {
|
|
m.ResourceId = resourceId
|
|
}
|
|
func (m *Gateway) GetResourceId() int {
|
|
return m.ResourceId
|
|
}
|
|
func (m *Gateway) GetName() string {
|
|
return m.Name
|
|
}
|
|
func (m *Gateway) GetId() int {
|
|
return m.Id
|
|
}
|
|
|
|
type GatewayCount struct {
|
|
Id int `gorm:"column:id"`
|
|
Count int64 `gorm:"column:count"`
|
|
}
|