mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
feat: 新增系统操作日志&其他优化
This commit is contained in:
25
server/internal/sys/domain/entity/syslog.go
Normal file
25
server/internal/sys/domain/entity/syslog.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package entity
|
||||
|
||||
import "time"
|
||||
|
||||
// 系统操作日志
|
||||
type Syslog struct {
|
||||
Id uint64 `json:"id"`
|
||||
CreateTime time.Time `json:"createTime"`
|
||||
CreatorId uint64 `json:"creatorId"`
|
||||
Creator string `json:"creator"`
|
||||
|
||||
Type int8 `json:"type"`
|
||||
Description string `json:"description"`
|
||||
ReqParam string `json:"reqParam"` // 请求参数
|
||||
Resp string `json:"resp"` // 响应结构
|
||||
}
|
||||
|
||||
func (a *Syslog) TableName() string {
|
||||
return "t_sys_log"
|
||||
}
|
||||
|
||||
const (
|
||||
SyslogTypeNorman int8 = 1 // 正常状态
|
||||
SyslogTypeError int8 = 2 // 错误状态
|
||||
)
|
||||
12
server/internal/sys/domain/repository/syslog.go
Normal file
12
server/internal/sys/domain/repository/syslog.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/sys/domain/entity"
|
||||
"mayfly-go/pkg/model"
|
||||
)
|
||||
|
||||
type Syslog interface {
|
||||
GetPageList(condition *entity.Syslog, pageParam *model.PageParam, toEntity interface{}, orderBy ...string) *model.PageResult
|
||||
|
||||
Insert(log *entity.Syslog)
|
||||
}
|
||||
Reference in New Issue
Block a user