32 lines
949 B
Go
32 lines
949 B
Go
package quota
|
|
|
|
import (
|
|
"time"
|
|
|
|
common "git.ilapage.cn/ila/yovision/Sense/server/common/models"
|
|
)
|
|
|
|
const SettingID uint = 1
|
|
|
|
type Setting struct {
|
|
ID uint `gorm:"primaryKey;autoIncrement:false" json:"id"`
|
|
Limit int `gorm:"not null" json:"limit"`
|
|
Source string `gorm:"size:32;not null;default:'database'" json:"source"`
|
|
Version int64 `gorm:"not null;default:1" json:"version"`
|
|
common.ControlBy
|
|
common.ModelTime
|
|
}
|
|
|
|
func (Setting) TableName() string { return "sense_quota_settings" }
|
|
|
|
type Change struct {
|
|
ID string `gorm:"size:36;primaryKey" json:"id"`
|
|
OldLimit int `gorm:"not null" json:"oldLimit"`
|
|
NewLimit int `gorm:"not null" json:"newLimit"`
|
|
Reason string `gorm:"size:512;not null" json:"reason"`
|
|
ChangedBy int `gorm:"not null;index" json:"changedBy"`
|
|
CreatedAt time.Time `gorm:"not null;index" json:"createdAt"`
|
|
}
|
|
|
|
func (Change) TableName() string { return "sense_quota_changes" }
|