Move notification interface to services layer (#26915)

Extract from #22266
This commit is contained in:
Lunny Xiao 2023-09-06 02:37:47 +08:00 committed by GitHub
parent 084eacb5d4
commit 540bf9fa6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 972 additions and 969 deletions

View file

@ -14,9 +14,9 @@ import (
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/sync"
notify_service "code.gitea.io/gitea/services/notify"
)
// repoWorkingPool represents a working pool to order the parallel changes to the same repository
@ -54,7 +54,7 @@ func TransferOwnership(ctx context.Context, doer, newOwner *user_model.User, rep
}
}
notification.NotifyTransferRepository(ctx, doer, repo, oldOwner.Name)
notify_service.TransferRepository(ctx, doer, repo, oldOwner.Name)
return nil
}
@ -77,7 +77,7 @@ func ChangeRepositoryName(ctx context.Context, doer *user_model.User, repo *repo
repoWorkingPool.CheckOut(fmt.Sprint(repo.ID))
repo.Name = newRepoName
notification.NotifyRenameRepository(ctx, doer, repo, oldRepoName)
notify_service.RenameRepository(ctx, doer, repo, oldRepoName)
return nil
}
@ -126,7 +126,7 @@ func StartRepositoryTransfer(ctx context.Context, doer, newOwner *user_model.Use
}
// notify users who are able to accept / reject transfer
notification.NotifyRepoPendingTransfer(ctx, doer, newOwner, repo)
notify_service.RepoPendingTransfer(ctx, doer, newOwner, repo)
return nil
}