24 lines
650 B
Go
24 lines
650 B
Go
package model
|
||
|
||
import (
|
||
"gorm.io/gorm"
|
||
)
|
||
|
||
type DeviceLog struct {
|
||
gorm.Model
|
||
DeviceUID string `gorm:"index" json:"device_uid"` // 设备UID
|
||
Action string `json:"action"` // 操作类型:register/start/verify/bind/unbind
|
||
Message string `json:"message"` // 详细信息
|
||
Status string `json:"status"` // 状态:success/failed
|
||
IP string `json:"ip"` // 操作IP
|
||
}
|
||
|
||
// 定义日志操作类型常量
|
||
const (
|
||
LogActionRegister = "register"
|
||
LogActionStart = "start"
|
||
LogActionVerify = "verify"
|
||
LogActionBind = "bind"
|
||
LogActionUnbind = "unbind"
|
||
)
|