您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // Copyright 2016 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package structs
  5. import (
  6. "time"
  7. )
  8. // PullRequest represents a pull request
  9. type PullRequest struct {
  10. ID int64 `json:"id"`
  11. URL string `json:"url"`
  12. Index int64 `json:"number"`
  13. Poster *User `json:"user"`
  14. Title string `json:"title"`
  15. Body string `json:"body"`
  16. Labels []*Label `json:"labels"`
  17. Milestone *Milestone `json:"milestone"`
  18. Assignee *User `json:"assignee"`
  19. Assignees []*User `json:"assignees"`
  20. State StateType `json:"state"`
  21. Comments int `json:"comments"`
  22. HTMLURL string `json:"html_url"`
  23. DiffURL string `json:"diff_url"`
  24. PatchURL string `json:"patch_url"`
  25. Mergeable bool `json:"mergeable"`
  26. HasMerged bool `json:"merged"`
  27. // swagger:strfmt date-time
  28. Merged *time.Time `json:"merged_at"`
  29. MergedCommitID *string `json:"merge_commit_sha"`
  30. MergedBy *User `json:"merged_by"`
  31. Base *PRBranchInfo `json:"base"`
  32. Head *PRBranchInfo `json:"head"`
  33. MergeBase string `json:"merge_base"`
  34. // swagger:strfmt date-time
  35. Deadline *time.Time `json:"due_date"`
  36. // swagger:strfmt date-time
  37. Created *time.Time `json:"created_at"`
  38. // swagger:strfmt date-time
  39. Updated *time.Time `json:"updated_at"`
  40. // swagger:strfmt date-time
  41. Closed *time.Time `json:"closed_at"`
  42. }
  43. // PRBranchInfo information about a branch
  44. type PRBranchInfo struct {
  45. Name string `json:"label"`
  46. Ref string `json:"ref"`
  47. Sha string `json:"sha"`
  48. RepoID int64 `json:"repo_id"`
  49. Repository *Repository `json:"repo"`
  50. }
  51. // ListPullRequestsOptions options for listing pull requests
  52. type ListPullRequestsOptions struct {
  53. Page int `json:"page"`
  54. State string `json:"state"`
  55. }
  56. // CreatePullRequestOption options when creating a pull request
  57. type CreatePullRequestOption struct {
  58. Head string `json:"head" binding:"Required"`
  59. Base string `json:"base" binding:"Required"`
  60. Title string `json:"title" binding:"Required"`
  61. Body string `json:"body"`
  62. Assignee string `json:"assignee"`
  63. Assignees []string `json:"assignees"`
  64. Milestone int64 `json:"milestone"`
  65. Labels []int64 `json:"labels"`
  66. // swagger:strfmt date-time
  67. Deadline *time.Time `json:"due_date"`
  68. }
  69. // EditPullRequestOption options when modify pull request
  70. type EditPullRequestOption struct {
  71. Title string `json:"title"`
  72. Body string `json:"body"`
  73. Assignee string `json:"assignee"`
  74. Assignees []string `json:"assignees"`
  75. Milestone int64 `json:"milestone"`
  76. Labels []int64 `json:"labels"`
  77. State *string `json:"state"`
  78. // swagger:strfmt date-time
  79. Deadline *time.Time `json:"due_date"`
  80. RemoveDeadline *bool `json:"unset_due_date"`
  81. }