diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-16 21:30:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 21:30:11 +0800 |
commit | 48ccd325a1b81a58ac6d1d5d94fc4e90974599ea (patch) | |
tree | e7bb31d69343dd9845a1b0df013b093c8720f14b /routers/api | |
parent | 447428f44659cee0e94e1c444f6291defac2bda2 (diff) | |
download | gitea-48ccd325a1b81a58ac6d1d5d94fc4e90974599ea.tar.gz gitea-48ccd325a1b81a58ac6d1d5d94fc4e90974599ea.zip |
Move some functions into services/repository (#17660)
Diffstat (limited to 'routers/api')
-rw-r--r-- | routers/api/v1/admin/adopt.go | 8 | ||||
-rw-r--r-- | routers/api/v1/admin/cron.go | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/routers/api/v1/admin/adopt.go b/routers/api/v1/admin/adopt.go index 9c1b9fc0f8..184a2941a8 100644 --- a/routers/api/v1/admin/adopt.go +++ b/routers/api/v1/admin/adopt.go @@ -9,9 +9,9 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" - "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/routers/api/v1/utils" + repo_service "code.gitea.io/gitea/services/repository" ) // ListUnadoptedRepositories lists the unadopted repositories that match the provided names @@ -41,7 +41,7 @@ func ListUnadoptedRepositories(ctx *context.APIContext) { // "$ref": "#/responses/forbidden" listOptions := utils.GetListOptions(ctx) - repoNames, count, err := repository.ListUnadoptedRepositories(ctx.FormString("query"), &listOptions) + repoNames, count, err := repo_service.ListUnadoptedRepositories(ctx.FormString("query"), &listOptions) if err != nil { ctx.InternalServerError(err) } @@ -104,7 +104,7 @@ func AdoptRepository(ctx *context.APIContext) { ctx.NotFound() return } - if _, err := repository.AdoptRepository(ctx.User, ctxUser, models.CreateRepoOptions{ + if _, err := repo_service.AdoptRepository(ctx.User, ctxUser, models.CreateRepoOptions{ Name: repoName, IsPrivate: true, }); err != nil { @@ -167,7 +167,7 @@ func DeleteUnadoptedRepository(ctx *context.APIContext) { return } - if err := repository.DeleteUnadoptedRepository(ctx.User, ctxUser, repoName); err != nil { + if err := repo_service.DeleteUnadoptedRepository(ctx.User, ctxUser, repoName); err != nil { ctx.InternalServerError(err) return } diff --git a/routers/api/v1/admin/cron.go b/routers/api/v1/admin/cron.go index 970fad8388..1476872a90 100644 --- a/routers/api/v1/admin/cron.go +++ b/routers/api/v1/admin/cron.go @@ -8,11 +8,11 @@ import ( "net/http" "code.gitea.io/gitea/modules/context" - "code.gitea.io/gitea/modules/cron" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/routers/api/v1/utils" + "code.gitea.io/gitea/services/cron" ) // ListCronTasks api for getting cron tasks |