mirror of
https://github.com/veops/oneterm.git
synced 2025-10-18 21:24:46 +08:00
api server
This commit is contained in:
46
backend/pkg/server/model/command.go
Normal file
46
backend/pkg/server/model/command.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/plugin/soft_delete"
|
||||
)
|
||||
|
||||
type Command struct {
|
||||
Id int `json:"id" gorm:"column:id;primarykey"`
|
||||
Name string `json:"name" gorm:"column:name"`
|
||||
Cmds Slice[string] `json:"cmds" gorm:"column:cmds"`
|
||||
Enable bool `json:"enable" gorm:"column:enable"`
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
func (m *Command) TableName() string {
|
||||
return "command"
|
||||
}
|
||||
func (m *Command) SetId(id int) {
|
||||
m.Id = id
|
||||
}
|
||||
func (m *Command) SetCreatorId(creatorId int) {
|
||||
m.CreatorId = creatorId
|
||||
}
|
||||
func (m *Command) SetUpdaterId(updaterId int) {
|
||||
m.UpdaterId = updaterId
|
||||
}
|
||||
func (m *Command) SetResourceId(resourceId int) {
|
||||
m.ResourceId = resourceId
|
||||
}
|
||||
func (m *Command) GetResourceId() int {
|
||||
return m.ResourceId
|
||||
}
|
||||
func (m *Command) GetName() string {
|
||||
return m.Name
|
||||
}
|
||||
func (m *Command) GetId() int {
|
||||
return m.Id
|
||||
}
|
Reference in New Issue
Block a user