日志包

This commit is contained in:
2025-10-31 16:34:39 +08:00
parent 60e90ee0e3
commit 51aea0589e
5 changed files with 208 additions and 0 deletions

10
model.go Normal file
View File

@@ -0,0 +1,10 @@
package logger
type Log struct {
ID uint64 `gorm:"column:id;primaryKey;autoIncrement;comment:自增ID" json:"id"`
Timestamp int64 `gorm:"column:timestamp;type:BIGINT;comment:时间" json:"timestamp"`
Level string `gorm:"column:level;type:VARCHAR(50);comment:日志级别" json:"level"`
Source string `gorm:"column:source;type:VARCHAR(255);comment:来源" json:"source"`
Action string `gorm:"column:action;type:VARCHAR(255);comment:操作" json:"action"`
Message string `gorm:"column:message;type:VARCHAR(255);comment:消息" json:"message"`
}