diff options
author | Zettat123 <zettat123@gmail.com> | 2023-04-04 21:35:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-04 21:35:31 +0800 |
commit | 6b0df6d8da76d77a9b5c42dcfa78dbfe197fd56d (patch) | |
tree | 6d78855ec0f8e4bed42a0ae7587687a4755b6536 /models/activities/action.go | |
parent | d149093ce3c32503b95c66208de6cb5861e4e666 (diff) | |
download | gitea-6b0df6d8da76d77a9b5c42dcfa78dbfe197fd56d.tar.gz gitea-6b0df6d8da76d77a9b5c42dcfa78dbfe197fd56d.zip |
Add activity feeds API (#23494)
Close #5666
Add APIs for getting activity feeds.
Diffstat (limited to 'models/activities/action.go')
-rw-r--r-- | models/activities/action.go | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/models/activities/action.go b/models/activities/action.go index 4111d8098b..f75ab55982 100644 --- a/models/activities/action.go +++ b/models/activities/action.go @@ -66,6 +66,67 @@ const ( ActionAutoMergePullRequest // 27 ) +func (at ActionType) String() string { + switch at { + case ActionCreateRepo: + return "create_repo" + case ActionRenameRepo: + return "rename_repo" + case ActionStarRepo: + return "star_repo" + case ActionWatchRepo: + return "watch_repo" + case ActionCommitRepo: + return "commit_repo" + case ActionCreateIssue: + return "create_issue" + case ActionCreatePullRequest: + return "create_pull_request" + case ActionTransferRepo: + return "transfer_repo" + case ActionPushTag: + return "push_tag" + case ActionCommentIssue: + return "comment_issue" + case ActionMergePullRequest: + return "merge_pull_request" + case ActionCloseIssue: + return "close_issue" + case ActionReopenIssue: + return "reopen_issue" + case ActionClosePullRequest: + return "close_pull_request" + case ActionReopenPullRequest: + return "reopen_pull_request" + case ActionDeleteTag: + return "delete_tag" + case ActionDeleteBranch: + return "delete_branch" + case ActionMirrorSyncPush: + return "mirror_sync_push" + case ActionMirrorSyncCreate: + return "mirror_sync_create" + case ActionMirrorSyncDelete: + return "mirror_sync_delete" + case ActionApprovePullRequest: + return "approve_pull_request" + case ActionRejectPullRequest: + return "reject_pull_request" + case ActionCommentPull: + return "comment_pull" + case ActionPublishRelease: + return "publish_release" + case ActionPullReviewDismissed: + return "pull_review_dismissed" + case ActionPullRequestReadyForReview: + return "pull_request_ready_for_review" + case ActionAutoMergePullRequest: + return "auto_merge_pull_request" + default: + return "action-" + strconv.Itoa(int(at)) + } +} + // Action represents user operation type and other information to // repository. It implemented interface base.Actioner so that can be // used in template render. |