mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-26 21:15:44 +00:00
@@ -217,7 +217,7 @@ func (app *OAuth2Application) GetGrantByUserID(ctx context.Context, userID int64
|
||||
return grant, nil
|
||||
}
|
||||
|
||||
// CreateGrant generates a grant for an user
|
||||
// CreateGrant generates a grant for a user
|
||||
func (app *OAuth2Application) CreateGrant(ctx context.Context, userID int64, scope string) (*OAuth2Grant, error) {
|
||||
grant := &OAuth2Grant{
|
||||
ApplicationID: app.ID,
|
||||
@@ -461,7 +461,7 @@ func GetOAuth2AuthorizationByCode(ctx context.Context, code string) (auth *OAuth
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
// OAuth2Grant represents the permission of an user for a specific application to access resources
|
||||
// OAuth2Grant represents the permission of a user for a specific application to access resources
|
||||
type OAuth2Grant struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UserID int64 `xorm:"INDEX unique(user_application)"`
|
||||
|
||||
@@ -67,7 +67,7 @@ func GetIssueWatch(ctx context.Context, userID, issueID int64) (iw *IssueWatch,
|
||||
return iw, exists, err
|
||||
}
|
||||
|
||||
// CheckIssueWatch check if an user is watching an issue
|
||||
// CheckIssueWatch check if a user is watching an issue
|
||||
// it takes participants and repo watch into account
|
||||
func CheckIssueWatch(ctx context.Context, user *user_model.User, issue *Issue) (bool, error) {
|
||||
iw, exist, err := GetIssueWatch(ctx, user.ID, issue.ID)
|
||||
|
||||
@@ -67,7 +67,7 @@ func (err ErrNotValidReviewRequest) Unwrap() error {
|
||||
return util.ErrInvalidArgument
|
||||
}
|
||||
|
||||
// ErrReviewRequestOnClosedPR represents an error when an user tries to request a re-review on a closed or merged PR.
|
||||
// ErrReviewRequestOnClosedPR represents an error when a user tries to request a re-review on a closed or merged PR.
|
||||
type ErrReviewRequestOnClosedPR struct{}
|
||||
|
||||
// IsErrReviewRequestOnClosedPR checks if an error is an ErrReviewRequestOnClosedPR.
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
)
|
||||
|
||||
// Star represents a starred repo by an user.
|
||||
// Star represents a starred repo by a user.
|
||||
type Star struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UID int64 `xorm:"UNIQUE(s)"`
|
||||
|
||||
@@ -68,12 +68,12 @@ const (
|
||||
type NotifySubjectType string
|
||||
|
||||
const (
|
||||
// NotifySubjectIssue an issue is subject of an notification
|
||||
// NotifySubjectIssue a issue is subject of an notification
|
||||
NotifySubjectIssue NotifySubjectType = "Issue"
|
||||
// NotifySubjectPull an pull is subject of an notification
|
||||
// NotifySubjectPull a pull is subject of an notification
|
||||
NotifySubjectPull NotifySubjectType = "Pull"
|
||||
// NotifySubjectCommit an commit is subject of an notification
|
||||
// NotifySubjectCommit a commit is subject of an notification
|
||||
NotifySubjectCommit NotifySubjectType = "Commit"
|
||||
// NotifySubjectRepository an repository is subject of an notification
|
||||
// NotifySubjectRepository a repository is subject of an notification
|
||||
NotifySubjectRepository NotifySubjectType = "Repository"
|
||||
)
|
||||
|
||||
@@ -392,7 +392,7 @@ func DeletePullReview(ctx *context.APIContext) {
|
||||
func CreatePullReview(ctx *context.APIContext) {
|
||||
// swagger:operation POST /repos/{owner}/{repo}/pulls/{index}/reviews repository repoCreatePullReview
|
||||
// ---
|
||||
// summary: Create a review to an pull request
|
||||
// summary: Create a review to a pull request
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
@@ -509,11 +509,11 @@ func CreatePullReview(ctx *context.APIContext) {
|
||||
ctx.JSON(http.StatusOK, apiReview)
|
||||
}
|
||||
|
||||
// SubmitPullReview submit a pending review to an pull request
|
||||
// SubmitPullReview submit a pending review to a pull request
|
||||
func SubmitPullReview(ctx *context.APIContext) {
|
||||
// swagger:operation POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id} repository repoSubmitPullReview
|
||||
// ---
|
||||
// summary: Submit a pending review to an pull request
|
||||
// summary: Submit a pending review to a pull request
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
@@ -693,7 +693,7 @@ func prepareSingleReview(ctx *context.APIContext) (*issues_model.Review, *issues
|
||||
return review, pr, false
|
||||
}
|
||||
|
||||
// CreateReviewRequests create review requests to an pull request
|
||||
// CreateReviewRequests create review requests to a pull request
|
||||
func CreateReviewRequests(ctx *context.APIContext) {
|
||||
// swagger:operation POST /repos/{owner}/{repo}/pulls/{index}/requested_reviewers repository repoCreatePullReviewRequests
|
||||
// ---
|
||||
@@ -734,7 +734,7 @@ func CreateReviewRequests(ctx *context.APIContext) {
|
||||
apiReviewRequest(ctx, *opts, true)
|
||||
}
|
||||
|
||||
// DeleteReviewRequests delete review requests to an pull request
|
||||
// DeleteReviewRequests delete review requests to a pull request
|
||||
func DeleteReviewRequests(ctx *context.APIContext) {
|
||||
// swagger:operation DELETE /repos/{owner}/{repo}/pulls/{index}/requested_reviewers repository repoDeletePullReviewRequests
|
||||
// ---
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
user_service "code.gitea.io/gitea/services/user"
|
||||
)
|
||||
|
||||
// UpdateAvatar updates the Avatar of an User
|
||||
// UpdateAvatar updates the Avatar of a User
|
||||
func UpdateAvatar(ctx *context.APIContext) {
|
||||
// swagger:operation POST /user/avatar user userUpdateAvatar
|
||||
// ---
|
||||
@@ -45,7 +45,7 @@ func UpdateAvatar(ctx *context.APIContext) {
|
||||
ctx.Status(http.StatusNoContent)
|
||||
}
|
||||
|
||||
// DeleteAvatar deletes the Avatar of an User
|
||||
// DeleteAvatar deletes the Avatar of a User
|
||||
func DeleteAvatar(ctx *context.APIContext) {
|
||||
// swagger:operation DELETE /user/avatar user userDeleteAvatar
|
||||
// ---
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
func CreateRegistrationToken(ctx *context.APIContext) {
|
||||
// swagger:operation POST /user/actions/runners/registration-token user userCreateRunnerRegistrationToken
|
||||
// ---
|
||||
// summary: Get an user's actions runner registration token
|
||||
// summary: Get a user's actions runner registration token
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
|
||||
@@ -48,7 +48,7 @@ func ListOwnerHooks(ctx *context.APIContext, owner *user_model.User) {
|
||||
ctx.JSON(http.StatusOK, apiHooks)
|
||||
}
|
||||
|
||||
// GetOwnerHook gets an user or organization webhook. Errors are written to ctx.
|
||||
// GetOwnerHook gets a user or organization webhook. Errors are written to ctx.
|
||||
func GetOwnerHook(ctx *context.APIContext, ownerID, hookID int64) (*webhook.Webhook, error) {
|
||||
w, err := webhook.GetWebhookByOwnerID(ctx, ownerID, hookID)
|
||||
if err != nil {
|
||||
@@ -114,7 +114,7 @@ func AddSystemHook(ctx *context.APIContext, form *api.CreateHookOption) {
|
||||
}
|
||||
}
|
||||
|
||||
// AddOwnerHook adds a hook to an user or organization
|
||||
// AddOwnerHook adds a hook to a user or organization
|
||||
func AddOwnerHook(ctx *context.APIContext, owner *user_model.User, form *api.CreateHookOption) {
|
||||
hook, ok := addHook(ctx, form, owner.ID, 0)
|
||||
if !ok {
|
||||
@@ -294,7 +294,7 @@ func EditSystemHook(ctx *context.APIContext, form *api.EditHookOption, hookID in
|
||||
ctx.JSON(http.StatusOK, h)
|
||||
}
|
||||
|
||||
// EditOwnerHook updates a webhook of an user or organization
|
||||
// EditOwnerHook updates a webhook of a user or organization
|
||||
func EditOwnerHook(ctx *context.APIContext, owner *user_model.User, form *api.EditHookOption, hookID int64) {
|
||||
hook, err := GetOwnerHook(ctx, owner.ID, hookID)
|
||||
if err != nil {
|
||||
|
||||
@@ -35,7 +35,7 @@ func isErrBlameNotFoundOrNotEnoughLines(err error) bool {
|
||||
return notFound || notEnoughLines
|
||||
}
|
||||
|
||||
// ErrDismissRequestOnClosedPR represents an error when an user tries to dismiss a review associated to a closed or merged PR.
|
||||
// ErrDismissRequestOnClosedPR represents an error when a user tries to dismiss a review associated to a closed or merged PR.
|
||||
type ErrDismissRequestOnClosedPR struct{}
|
||||
|
||||
// IsErrDismissRequestOnClosedPR checks if an error is an ErrDismissRequestOnClosedPR.
|
||||
@@ -52,7 +52,7 @@ func (err ErrDismissRequestOnClosedPR) Unwrap() error {
|
||||
return util.ErrPermissionDenied
|
||||
}
|
||||
|
||||
// ErrSubmitReviewOnClosedPR represents an error when an user tries to submit an approve or reject review associated to a closed or merged PR.
|
||||
// ErrSubmitReviewOnClosedPR represents an error when a user tries to submit an approve or reject review associated to a closed or merged PR.
|
||||
var ErrSubmitReviewOnClosedPR = errors.New("can't submit review for a closed or merged PR")
|
||||
|
||||
// LineBlame returns the latest commit at the given line
|
||||
|
||||
@@ -27,7 +27,7 @@ import (
|
||||
"xorm.io/builder"
|
||||
)
|
||||
|
||||
// deleteUser deletes models associated to an user.
|
||||
// deleteUser deletes models associated to a user.
|
||||
func deleteUser(ctx context.Context, u *user_model.User, purge bool) (err error) {
|
||||
e := db.GetEngine(ctx)
|
||||
|
||||
|
||||
10
templates/swagger/v1_json.tmpl
generated
10
templates/swagger/v1_json.tmpl
generated
@@ -14805,7 +14805,7 @@
|
||||
"tags": [
|
||||
"repository"
|
||||
],
|
||||
"summary": "Create a review to an pull request",
|
||||
"summary": "Create a review to a pull request",
|
||||
"operationId": "repoCreatePullReview",
|
||||
"parameters": [
|
||||
{
|
||||
@@ -14910,7 +14910,7 @@
|
||||
"tags": [
|
||||
"repository"
|
||||
],
|
||||
"summary": "Submit a pending review to an pull request",
|
||||
"summary": "Submit a pending review to a pull request",
|
||||
"operationId": "repoSubmitPullReview",
|
||||
"parameters": [
|
||||
{
|
||||
@@ -18763,7 +18763,7 @@
|
||||
"tags": [
|
||||
"user"
|
||||
],
|
||||
"summary": "Get an user's actions runner registration token",
|
||||
"summary": "Get a user's actions runner registration token",
|
||||
"operationId": "userCreateRunnerRegistrationToken",
|
||||
"responses": {
|
||||
"200": {
|
||||
@@ -27268,7 +27268,7 @@
|
||||
"x-go-name": "Title"
|
||||
},
|
||||
"type": {
|
||||
"description": "Type indicates the type of the notification subject\nIssue NotifySubjectIssue NotifySubjectIssue an issue is subject of an notification\nPull NotifySubjectPull NotifySubjectPull an pull is subject of an notification\nCommit NotifySubjectCommit NotifySubjectCommit an commit is subject of an notification\nRepository NotifySubjectRepository NotifySubjectRepository an repository is subject of an notification",
|
||||
"description": "Type indicates the type of the notification subject\nIssue NotifySubjectIssue NotifySubjectIssue a issue is subject of an notification\nPull NotifySubjectPull NotifySubjectPull a pull is subject of an notification\nCommit NotifySubjectCommit NotifySubjectCommit a commit is subject of an notification\nRepository NotifySubjectRepository NotifySubjectRepository a repository is subject of an notification",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Issue",
|
||||
@@ -27276,7 +27276,7 @@
|
||||
"Commit",
|
||||
"Repository"
|
||||
],
|
||||
"x-go-enum-desc": "Issue NotifySubjectIssue NotifySubjectIssue an issue is subject of an notification\nPull NotifySubjectPull NotifySubjectPull an pull is subject of an notification\nCommit NotifySubjectCommit NotifySubjectCommit an commit is subject of an notification\nRepository NotifySubjectRepository NotifySubjectRepository an repository is subject of an notification",
|
||||
"x-go-enum-desc": "Issue NotifySubjectIssue NotifySubjectIssue a issue is subject of an notification\nPull NotifySubjectPull NotifySubjectPull a pull is subject of an notification\nCommit NotifySubjectCommit NotifySubjectCommit a commit is subject of an notification\nRepository NotifySubjectRepository NotifySubjectRepository a repository is subject of an notification",
|
||||
"x-go-name": "Type"
|
||||
},
|
||||
"url": {
|
||||
|
||||
Reference in New Issue
Block a user