package model

// OperationLog 操作行为日志表
type OperationLog struct {
	Id            string `xorm:"not null pk autoincr INT(11)" json:"id"`                // 主键
	Action        string `xorm:"VARCHAR(40) DEFAULT '' NOT NULL" json:"action"`         // 操作动作(新增,修改,删除)
	Category      string `xorm:"VARCHAR(40) DEFAULT '' NOT NULL" json:"category"`       // 操作类型(用户/部门/角色/项目……)
	TargetId      string `xorm:"VARCHAR(40) DEFAULT '' NOT NULL" json:"targetId"`       // 操作目标,用户/部门/角色/项目……
	OldValue      string `xorm:"TEXT NOT NULL" json:"oldValue"`                         // 操作前旧值
	NewValue      string `xorm:"TEXT NOT NULL" json:"newValue"`                         // 操作后新值
	Operator      string `xorm:"VARCHAR(40) DEFAULT 'SYSDBA' NOT NULL" json:"operator"` // 操作者,默认为系统数据库管理员
	OperateAddr   string `xorm:"VARCHAR(100) DEFAULT '' NOT NULL" json:"operateIP"`     // 操作者IP+端口信息
	OperateDevice string `xorm:"VARCHAR(160) DEFAULT '' NOT NULL" json:"operateDevice"` // 操作设备类型
	OperateTime   int64  `xorm:"created" json:"operateTime"`                            // 操作时间
}