userLog.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334
  1. package entity
  2. type RecordListReq struct {
  3. ID string `json:"id" bson:"_id"` // ID
  4. UserName string `json:"user_name" bson:"user_name"` // 用户名
  5. RoleId string `json:"role_id" bson:"role_id"` // 角色ID
  6. Path string `json:"path" bson:"url"` // 请求路径
  7. StatusCode int `json:"status_code" bson:"status_code"` // HTTP状态码
  8. ClientIP string `json:"client_ip"` // 客户端IP
  9. StartTime int64 `json:"start_time"` // 开始时间
  10. EndTime int64 `json:"end_time"` // 结束时间
  11. DurMin int64 `json:"dur_min"` // 请求耗时(毫秒)最小值
  12. DurMax int64 `json:"dur_max"` // 请求耗时(毫秒)最大值
  13. Page int `json:"page"` // 页码
  14. Size int `json:"size"` // 每页数量
  15. }
  16. type RecordListResp struct {
  17. Details []*RecordListDetail `json:"details"`
  18. Total int64 `json:"total"`
  19. }
  20. type RecordListDetail struct {
  21. Id string `json:"id" bson:"_id"` // 自增ID
  22. Username string `json:"user_name" bson:"user_name"` // 用户名
  23. RoleId string `json:"role_id" bson:"role_id"` // 角色ID
  24. Path string `json:"url" bson:"url"` // 请求路径
  25. Method string `json:"method" bson:"method"` // 请求方法
  26. StatusCode int `json:"status_code" bson:"status_code"` // HTTP状态码
  27. Dur int64 `json:"dur" bson:"dur"` // 请求耗时(毫秒)
  28. ClientIP string `json:"client_ip" bson:"client_ip"` // 客户端IP
  29. ErrorMessage string `json:"error_message" bson:"error_message"` // 错误信息
  30. CreatedAt int64 `json:"created_at" bson:"created_at"`
  31. }