31 lines
1016 B
Go
31 lines
1016 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
// RequestLog 是请求日志记录
|
|
type RequestLog struct {
|
|
ID string `json:"id"`
|
|
Timestamp time.Time `json:"timestamp"`
|
|
Service string `json:"service"`
|
|
Path string `json:"path"`
|
|
StatusCode int `json:"status_code"`
|
|
LatencyMs float64 `json:"latency_ms"`
|
|
UserID string `json:"user_id"`
|
|
SupplierID string `json:"supplier_id"`
|
|
Method string `json:"method"`
|
|
ErrorCode string `json:"error_code,omitempty"`
|
|
}
|
|
|
|
// LogQueryFilter 是日志查询过滤条件
|
|
type LogQueryFilter struct {
|
|
StartTime *time.Time `json:"start_time,omitempty"`
|
|
EndTime *time.Time `json:"end_time,omitempty"`
|
|
Service string `json:"service,omitempty"`
|
|
Path string `json:"path,omitempty"`
|
|
StatusCode *int `json:"status_code,omitempty"`
|
|
UserID string `json:"user_id,omitempty"`
|
|
SupplierID string `json:"supplier_id,omitempty"`
|
|
Page int `json:"page"`
|
|
PageSize int `json:"page_size"`
|
|
}
|