Files
2020-11-23 09:37:11 +08:00

53 lines
1.6 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
import "time"
const (
SysGroupID = 666666
)
type OperateEvent struct {
ID int64 `orm:"column(id)" json:"id"`
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"`
LastOperator string `orm:"size(32)" json:"lastOperator"` // 最后操作员
AccessUUID string `orm:"column(access_uuid)" json:"accessUUID"`
UserID string `orm:"column(user_id)" json:"userID"`
APIFunction string `orm:"column(api_function)" json:"apiFunction"`
JsonData string `orm:"size(3200)" json:"jsonData"`
ErrCode string `orm:"size(32)" json:"errCode"`
ErrMsg string `orm:"size(9999)" json:"errMsg"`
UseTime int `json:"useTime"`
}
func (v *OperateEvent) TableIndex() [][]string {
return [][]string{
[]string{"AccessUUID"},
[]string{"UserID"},
[]string{"APIFunction"},
[]string{"CreatedAt"},
}
}
type OperateEventDetail struct {
ID int64 `orm:"column(id)" json:"id"`
OperateType int `json:"operateType"` // 1为修改2为新增4为删除
ThingID int `orm:"column(thing_id)" json:"thingID"`
ThingType int `json:"thingType"` //各字段类型
StoreID int `orm:"column(store_id)" json:"storeID"`
AccessUUID string `orm:"column(access_uuid)" json:"accessUUID"`
BeforeData string `orm:"size(3200)" json:"beforeData"`
AfterData string `orm:"size(3200)" json:"afterData"`
}
func (v *OperateEventDetail) TableIndex() [][]string {
return [][]string{
[]string{"AccessUUID"},
}
}
func (*OperateEventDetail) TableUnique() [][]string {
return [][]string{
[]string{"ThingID", "StoreID", "AccessUUID"},
}
}