Files
common/log/model/dto/log_dto.go

51 lines
2.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package dto
import (
"gitee.com/red-future---jilin-g/common/beans"
"github.com/gogf/gf/v2/frame/g"
)
// ========== 操作日志查询相关DTO ==========
// GetLogReq 获取操作日志请求
type GetLogReq struct {
g.Meta `path:"/getLog" method:"get" tags:"操作日志" summary:"获取操作日志详情" dc:"根据日志ID获取操作日志的详细信息"`
ID string `json:"id" v:"required" dc:"日志ID"`
}
// GetLogResp 获取操作日志响应
type GetLogResp struct {
OperationLogInfo
}
// OperationLogInfo 操作日志信息
type OperationLogInfo struct {
ID string `json:"id" dc:"日志ID"`
ServiceName string `json:"service_name" dc:"服务名"`
Collection string `json:"collection" dc:"数据所在集合名称"`
CollectionID string `json:"collection_id" dc:"数据ID"`
Operation string `json:"operation" dc:"操作类型"`
UserName string `json:"user_name" dc:"操作人名称"`
IPAddress string `json:"ip_address" dc:"操作IP地址"`
Data map[string]interface{} `json:"data" dc:"当前数据"`
}
// ListLogsReq 查询操作日志列表请求(通用方法,支持根据不同条件动态查询)
type ListLogsReq struct {
g.Meta `path:"/listLogs" method:"get" tags:"操作日志" summary:"查询操作日志列表" dc:"根据多个条件查询操作日志列表"`
beans.Page
ServiceName string `json:"service_name" dc:"服务名(可选)"`
Collection string `json:"collection" dc:"数据所在集合名称(可选)"`
CollectionID string `json:"collection_id" dc:"数据ID可选"`
Operation string `json:"operation" dc:"操作类型(可选)"`
StartTime string `json:"start_time" dc:"开始时间(可选)"`
EndTime string `json:"end_time" dc:"结束时间(可选)"`
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序字段"`
}
// ListLogsResp 查询操作日志列表响应
type ListLogsResp struct {
Logs []OperationLogInfo `json:"logs" dc:"日志列表"`
Total int64 `json:"total" dc:"总数"`
}