mr.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package model
  2. import "time"
  3. // ProjectMrReportReq ...
  4. type ProjectMrReportReq struct {
  5. ProjectID int `form:"project_id"`
  6. Member string `form:"member"`
  7. Username string `form:"username"`
  8. }
  9. // ProjectMrReportResp ...
  10. type ProjectMrReportResp struct {
  11. ChangeAdd int `json:"change_add"`
  12. ChangeDel int `json:"change_del"`
  13. MrCount int `json:"mr_count"`
  14. StateCount int `json:"merged_count"`
  15. Discussion int `json:"discussion"`
  16. Resolve int `json:"resolved_discussion"`
  17. AverageMerge string `json:"average_merge_time"`
  18. Reviewers []string `json:"reviewer"`
  19. SpentTime string `json:"spent_time"`
  20. ReviewerOther []string `json:"reviewer_other"`
  21. ReviewChangeAdd int `json:"review_add"`
  22. ReviewChangeDel int `json:"review_del"`
  23. ReviewTotalTime string `json:"review_total_time"`
  24. }
  25. // MrReviewer ...
  26. type MrReviewer struct {
  27. ID int `json:"id"`
  28. Name string `json:"name"`
  29. FinishedAt *time.Time `json:"finished_at"`
  30. UserType string `json:"type"`
  31. // SpentTime 其实是反应时间+review时间
  32. SpentTime int `json:"spent_time"`
  33. }
  34. // MrInfo ...
  35. type MrInfo struct {
  36. ProjectID int `json:"project_id"`
  37. MrID int `json:"mr_id"`
  38. State string `json:"state"`
  39. SpentTime int `json:"spent_time"`
  40. Author string `json:"author"`
  41. ChangeAdd int `json:"change_add"`
  42. ChangeDel int `json:"change_del"`
  43. TotalDiscussion int `json:"total_discussion"`
  44. SolvedDiscussion int `json:"solved_discussion"`
  45. Reviewers []*MrReviewer `json:"reviewers"`
  46. }