1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

API: Add pull review endpoints (#11224)

* API: Added pull review read only endpoints

* Update Structs, move Conversion, Refactor

* refactor

* lint & co

* fix lint + refactor

* add new Review state, rm unessesary, refacotr loadAttributes, convert patch to diff

* add DeletePullReview

* add paggination

* draft1: Create & submit review

* fix lint

* fix lint

* impruve test

* DONT use GhostUser for loadReviewer

* expose comments_count of a PullReview

* infent GetCodeCommentsCount()

* fixes

* fix+impruve

* some nits

* Handle Ghosts 👻

* add TEST for GET apis

* complete TESTS

* add HTMLURL to PullReview responce

* code format as per @lafriks

* update swagger definition

* Update routers/api/v1/repo/pull_review.go

Co-authored-by: David Svantesson <davidsvantesson@gmail.com>

* add comments

Co-authored-by: Thomas Berger <loki@lokis-chaos.de>
Co-authored-by: David Svantesson <davidsvantesson@gmail.com>
This commit is contained in:
6543
2020-05-02 02:20:51 +02:00
committed by GitHub
parent 4ed7d2a2bb
commit c97494a4f4
12 changed files with 1580 additions and 26 deletions

View File

@@ -137,4 +137,13 @@ type swaggerParameterBodies struct {
// in:body
CreateOAuth2ApplicationOptions api.CreateOAuth2ApplicationOptions
// in:body
CreatePullReviewOptions api.CreatePullReviewOptions
// in:body
CreatePullReviewComment api.CreatePullReviewComment
// in:body
SubmitPullReviewOptions api.SubmitPullReviewOptions
}

View File

@@ -141,6 +141,34 @@ type swaggerResponsePullRequestList struct {
Body []api.PullRequest `json:"body"`
}
// PullReview
// swagger:response PullReview
type swaggerResponsePullReview struct {
// in:body
Body api.PullReview `json:"body"`
}
// PullReviewList
// swagger:response PullReviewList
type swaggerResponsePullReviewList struct {
// in:body
Body []api.PullReview `json:"body"`
}
// PullComment
// swagger:response PullReviewComment
type swaggerPullReviewComment struct {
// in:body
Body api.PullReviewComment `json:"body"`
}
// PullCommentList
// swagger:response PullReviewCommentList
type swaggerResponsePullReviewCommentList struct {
// in:body
Body []api.PullReviewComment `json:"body"`
}
// Status
// swagger:response Status
type swaggerResponseStatus struct {
@@ -172,35 +200,35 @@ type swaggerResponseSearchResults struct {
// AttachmentList
// swagger:response AttachmentList
type swaggerResponseAttachmentList struct {
//in: body
// in: body
Body []api.Attachment `json:"body"`
}
// Attachment
// swagger:response Attachment
type swaggerResponseAttachment struct {
//in: body
// in: body
Body api.Attachment `json:"body"`
}
// GitTreeResponse
// swagger:response GitTreeResponse
type swaggerGitTreeResponse struct {
//in: body
// in: body
Body api.GitTreeResponse `json:"body"`
}
// GitBlobResponse
// swagger:response GitBlobResponse
type swaggerGitBlobResponse struct {
//in: body
// in: body
Body api.GitBlobResponse `json:"body"`
}
// Commit
// swagger:response Commit
type swaggerCommit struct {
//in: body
// in: body
Body api.Commit `json:"body"`
}
@@ -222,28 +250,28 @@ type swaggerCommitList struct {
// True if there is another page
HasMore bool `json:"X-HasMore"`
//in: body
// in: body
Body []api.Commit `json:"body"`
}
// EmptyRepository
// swagger:response EmptyRepository
type swaggerEmptyRepository struct {
//in: body
// in: body
Body api.APIError `json:"body"`
}
// FileResponse
// swagger:response FileResponse
type swaggerFileResponse struct {
//in: body
// in: body
Body api.FileResponse `json:"body"`
}
// ContentsResponse
// swagger:response ContentsResponse
type swaggerContentsResponse struct {
//in: body
// in: body
Body api.ContentsResponse `json:"body"`
}
@@ -257,20 +285,20 @@ type swaggerContentsListResponse struct {
// FileDeleteResponse
// swagger:response FileDeleteResponse
type swaggerFileDeleteResponse struct {
//in: body
// in: body
Body api.FileDeleteResponse `json:"body"`
}
// TopicListResponse
// swagger:response TopicListResponse
type swaggerTopicListResponse struct {
//in: body
// in: body
Body []api.TopicResponse `json:"body"`
}
// TopicNames
// swagger:response TopicNames
type swaggerTopicNames struct {
//in: body
// in: body
Body api.TopicName `json:"body"`
}