系统日志服务写入

This commit is contained in:
ayflying
2025-02-28 14:21:48 +08:00
parent e45e8c7572
commit fab208c121
5 changed files with 374 additions and 0 deletions

34
service/system_log.go Normal file
View File

@@ -0,0 +1,34 @@
// ================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================
package service
import (
v1 "github.com/ayflying/utility_go/api/admin/v1"
"github.com/gogf/gf/v2/frame/g"
)
type (
ISystemLog interface {
List(page int) (list []*v1.SystemLog, max int, err error)
// 写入操作日志
AddLog(uid int, url string, ip string, data g.Map) (id int64, err error)
}
)
var (
localSystemLog ISystemLog
)
func SystemLog() ISystemLog {
if localSystemLog == nil {
panic("implement not found for interface ISystemLog, forgot register?")
}
return localSystemLog
}
func RegisterSystemLog(i ISystemLog) {
localSystemLog = i
}