userLog.go 1.4 KB

1234567891011121314151617181920212223242526272829
  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. StartTime int64 `json:"start_time"` // 开始时间
  7. EndTime int64 `json:"end_time"` // 结束时间
  8. Page int `json:"page"` // 页码
  9. Size int `json:"size"` // 每页数量
  10. }
  11. type RecordListResp struct {
  12. Details []*RecordListDetail `json:"details"`
  13. Total int64 `json:"total"`
  14. }
  15. type RecordListDetail struct {
  16. Id string `json:"id" bson:"_id"` // 自增ID
  17. Username string `json:"user_name" bson:"user_name"` // 用户名
  18. RoleId string `json:"role_id" bson:"role_id"` // 角色ID
  19. Path string `json:"url" bson:"url"` // 请求路径
  20. Method string `json:"method" bson:"method"` // 请求方法
  21. StatusCode int `json:"status_code" bson:"status_code"` // HTTP状态码
  22. Dur int64 `json:"dur" bson:"dur"` // 请求耗时(毫秒)
  23. ClientIP string `json:"client_ip" bson:"client_ip"` // 客户端IP
  24. ErrorMessage string `json:"error_message" bson:"error_message"` // 错误信息
  25. CreatedAt int64 `json:"created_at" bson:"created_at"`
  26. }