branch.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package model
  2. import "time"
  3. // BranchDeleted ...
  4. const BranchDeleted = true
  5. // BranchDiffWithRequest ...
  6. type BranchDiffWithRequest struct {
  7. ProjectID int `form:"project_id"`
  8. Master string `form:"comparator"`
  9. SortBy string `form:"sort_by"`
  10. Branch string `form:"branch"`
  11. Username string `form:"username"`
  12. }
  13. // BranchDiffWithResponse ...
  14. type BranchDiffWithResponse struct {
  15. Branch string `json:"branch"`
  16. Behind int `json:"behind"`
  17. Ahead int `json:"ahead"`
  18. LatestSyncTime *time.Time `json:"latest_sync_time"`
  19. LatestUpdateTime *time.Time `json:"latest_update_time"`
  20. }
  21. // CommitTreeNode ...
  22. type CommitTreeNode struct {
  23. CommitID string `json:"commit_id"`
  24. Parents []string `json:"parents"`
  25. CreatedAt *time.Time `json:"created_at"`
  26. Author string `json:"author"`
  27. }
  28. // StatisticsBranches ...
  29. type StatisticsBranches struct {
  30. ID int `json:"id" gorm:"AUTO_INCREMENT;primary_key;" form:"id"`
  31. ProjectID int `json:"project_id"`
  32. ProjectName string `json:"project_name"`
  33. CommitID string `json:"commit_id"`
  34. BranchName string `json:"branch_name"`
  35. Protected bool `json:"protected"`
  36. Merged bool `json:"merged"`
  37. DevelopersCanPush bool `json:"developers_can_push"`
  38. DevelopersCanMerge bool `json:"developers_can_merge"`
  39. IsDeleted bool `json:"is_deleted"`
  40. }
  41. // AggregateBranches ...
  42. type AggregateBranches struct {
  43. ID int `json:"id" gorm:"AUTO_INCREMENT;primary_key;" form:"id"`
  44. ProjectID int `json:"project_id"`
  45. ProjectName string `json:"project_name"`
  46. BranchName string `json:"branch_name"`
  47. BranchUserName string `json:"branch_user_name"`
  48. BranchMaster string `json:"branch_master"`
  49. Behind int `json:"behind"`
  50. Ahead int `json:"ahead"`
  51. LatestSyncTime *time.Time `json:"latest_sync_time"`
  52. LatestUpdateTime *time.Time `json:"latest_update_time"`
  53. IsDeleted bool `json:"is_deleted"`
  54. }