forgejo/routers/api/v1/repo
wxiaoguang 6b33152b7d
Decouple the different contexts from each other (#24786)
Replace #16455

Close #21803

Mixing different Gitea contexts together causes some problems:

1. Unable to respond proper content when error occurs, eg: Web should
respond HTML while API should respond JSON
2. Unclear dependency, eg: it's unclear when Context is used in
APIContext, which fields should be initialized, which methods are
necessary.


To make things clear, this PR introduces a Base context, it only
provides basic Req/Resp/Data features.

This PR mainly moves code. There are still many legacy problems and
TODOs in code, leave unrelated changes to future PRs.
2023-05-21 09:50:53 +08:00
..
blob.go
branch.go Create a branch directly from commit on the create branch API (#22956) 2023-05-09 18:22:32 +08:00
collaborators.go
commits.go Filter get single commit (#24613) 2023-05-10 09:34:07 +08:00
file.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
fork.go
git_hook.go
git_ref.go
hook.go
hook_test.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
issue.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
issue_attachment.go
issue_comment.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
issue_comment_attachment.go
issue_dependency.go
issue_label.go
issue_reaction.go
issue_stopwatch.go
issue_subscription.go
issue_tracked_time.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
key.go
label.go
language.go
main_test.go
migrate.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
milestone.go
mirror.go
notes.go Filters for GetAllCommits (#24568) 2023-05-09 09:06:05 +08:00
patch.go
pull.go Filters for GetAllCommits (#24568) 2023-05-09 09:06:05 +08:00
pull_review.go
release.go
release_attachment.go
release_tags.go
repo.go
repo_test.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
star.go
status.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
subscriber.go
tag.go
teams.go
topic.go
transfer.go
tree.go
wiki.go