kra-new/internal/service/dto/audit.go

145 lines
4.1 KiB
Go

package dto
import "time"
type OperationRecordRequest struct {
IP string
Method string
Path string
Status int
LatencyMS int64
Agent string
ErrorMessage string
Body string
Response string
UserID uint
RequestID string
TraceID string
DeviceID string
}
type DataAccessRecordRequest struct {
EventType string
Operation string
UserID uint
AuthorityID uint
RequestID string
Method string
Path string
Detail string
}
type DataAccessListRequest struct {
Page int `json:"page"`
PageSize int `json:"pageSize"`
EventType string `json:"eventType"`
TargetTable string `json:"targetTable"`
UserID uint `json:"userId"`
}
type ErrorRecordRequest struct {
ID uint `json:"ID"`
Form string `json:"form"`
Info string `json:"info"`
Level string `json:"level"`
RequestID string `json:"request_id"`
TraceID string `json:"trace_id"`
Solution string `json:"solution"`
Status string `json:"status"`
}
type OperationRecordResponse struct {
ID uint `json:"ID"`
CreatedAt time.Time `json:"CreatedAt"`
DeletedAt any `json:"DeletedAt"`
IP string `json:"ip"`
Method string `json:"method"`
Path string `json:"path"`
Status int `json:"status"`
LatencyMS int64 `json:"latency_ms"`
Agent string `json:"agent"`
ErrorMessage string `json:"error_message"`
Body string `json:"body"`
Response string `json:"resp"`
UserID uint `json:"user_id"`
RequestID string `json:"request_id"`
TraceID string `json:"trace_id"`
DeviceID string `json:"device_id"`
User any `json:"user"`
}
type LoginLogResponse struct {
ID uint `json:"ID"`
CreatedAt time.Time `json:"CreatedAt"`
DeletedAt any `json:"DeletedAt"`
Username string `json:"username"`
IP string `json:"ip"`
Status bool `json:"status"`
ErrorMessage string `json:"errorMessage"`
Agent string `json:"agent"`
UserID uint `json:"userId"`
User any `json:"user"`
}
type DataAccessLogResponse struct {
ID uint `json:"ID"`
CreatedAt time.Time `json:"CreatedAt"`
DeletedAt any `json:"DeletedAt"`
EventType string `json:"eventType"`
TargetTable string `json:"targetTable"`
Operation string `json:"operation"`
UserID uint `json:"userId"`
AuthorityID uint `json:"authorityId"`
Scope int `json:"scope"`
RequestID string `json:"requestId"`
Method string `json:"method"`
Path string `json:"path"`
Detail string `json:"detail"`
}
type ErrorRecordResponse struct {
ID uint `json:"ID"`
CreatedAt time.Time `json:"CreatedAt"`
DeletedAt any `json:"DeletedAt"`
Form string `json:"form"`
Info string `json:"info"`
Level string `json:"level"`
RequestID string `json:"request_id"`
TraceID string `json:"trace_id"`
Solution string `json:"solution"`
Status string `json:"status"`
}
type LogDateResponse struct {
Date string `json:"date"`
FileCount int `json:"fileCount"`
}
type LogDatesResponse struct {
Month string `json:"month"`
Dates []*LogDateResponse `json:"dates"`
}
type LogFileResponse struct {
Path string `json:"path"`
Name string `json:"name"`
Size int64 `json:"size"`
ModifiedAt time.Time `json:"modifiedAt"`
}
type LogFilesResponse struct {
Date string `json:"date"`
Files []*LogFileResponse `json:"files"`
}
type LogContentResponse struct {
Date string `json:"date"`
Path string `json:"path"`
Content string `json:"content"`
LineCount int `json:"lineCount"`
NextCursor int64 `json:"nextCursor"`
HasMore bool `json:"hasMore"`
LimitedByBytes bool `json:"limitedByBytes"`
Size int64 `json:"size"`
ModifiedAt time.Time `json:"modifiedAt"`
}