job.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package model
  2. import "time"
  3. // ProjectJobRequest ...
  4. type ProjectJobRequest struct {
  5. ProjectID int `form:"project_id"`
  6. Scope string `form:"state"`
  7. User string `form:"user"`
  8. Branch string `form:"branch"`
  9. Machine string `form:"machine"`
  10. StatisticsType int `form:"statistics_type"`
  11. Username string `form:"username"`
  12. }
  13. // ProjectJobResp ...
  14. type ProjectJobResp struct {
  15. ProjectID int `json:"project_id"`
  16. QueryDescription string `json:"query_description"`
  17. TotalItem int `json:"total"`
  18. State string `json:"state"`
  19. DataInfo []*DateJobInfo `json:"data_info"`
  20. }
  21. // DateJobInfo ...
  22. type DateJobInfo struct {
  23. Date string `json:"date"`
  24. JobTotal int `json:"total_num"`
  25. StatusNum int `json:"status_num"`
  26. PendingTime float64 `json:"pending_time"`
  27. RunningTime float64 `json:"running_time"`
  28. SlowestPendingJob []*ProjectJob `json:"slowest_pending_jobs"`
  29. }
  30. // ProjectJob ...
  31. type ProjectJob struct {
  32. Status string
  33. User string
  34. Branch string
  35. Machine string
  36. CreatedAt *time.Time
  37. StartedAt *time.Time
  38. FinishedAt *time.Time
  39. }