26 lines
1.1 KiB
Go
26 lines
1.1 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"git.apinb.com/bsm-sdk/core/database"
|
|
)
|
|
|
|
type LogData struct {
|
|
ID uint `gorm:"column:id;primarykey;" json:"id"`
|
|
CreatedAt time.Time `gorm:"column:created_at;type:TIMESTAMP;" json:"created_at"`
|
|
Service string `gorm:"column:service;type:varchar(255);def:'def'" json:"service"` // 服务名称
|
|
OpID uint `gorm:"column:op_id;" json:"op_id"` // 操作人员ID
|
|
OpName string `gorm:"column:op_name;type:varchar(255);" json:"op_name"` // 操作人员姓名
|
|
OpIp string `gorm:"column:ip;type:varchar(255);def:'0.0.0.0'" json:"ip"` // 操作IP
|
|
DataType string `gorm:"column:data_type;type:varchar(255);" json:"data_type"` // 数据类型
|
|
Level uint `gorm:"column:level;def:1" json:"level"` // 日志级别 1:信息 2:警告 3:错误
|
|
Content string `gorm:"column:content;" json:"content"` // 日志内容
|
|
Hmac string `gorm:"column:hmac;" json:"hmac"`
|
|
Encry bool `gorm:"-" json:"encry"`
|
|
}
|
|
|
|
func init() {
|
|
database.AppendMigrate(&LogData{})
|
|
}
|