forked from forgejo/forgejo
Move repository model into models/repo (#17933)
* Some refactors related repository model * Move more methods out of repository * Move repository into models/repo * Fix test * Fix test * some improvements * Remove unnecessary function
This commit is contained in:
parent
fb8166c6c6
commit
719bddcd76
301 changed files with 3193 additions and 2919 deletions
|
@ -6,6 +6,7 @@ package base
|
|||
|
||||
import (
|
||||
"code.gitea.io/gitea/models"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/repository"
|
||||
)
|
||||
|
@ -23,7 +24,7 @@ func (*NullNotifier) Run() {
|
|||
}
|
||||
|
||||
// NotifyCreateIssueComment places a place holder function
|
||||
func (*NullNotifier) NotifyCreateIssueComment(doer *user_model.User, repo *models.Repository,
|
||||
func (*NullNotifier) NotifyCreateIssueComment(doer *user_model.User, repo *repo_model.Repository,
|
||||
issue *models.Issue, comment *models.Comment, mentions []*user_model.User) {
|
||||
}
|
||||
|
||||
|
@ -121,53 +122,53 @@ func (*NullNotifier) NotifyIssueChangeLabels(doer *user_model.User, issue *model
|
|||
}
|
||||
|
||||
// NotifyCreateRepository places a place holder function
|
||||
func (*NullNotifier) NotifyCreateRepository(doer *user_model.User, u *user_model.User, repo *models.Repository) {
|
||||
func (*NullNotifier) NotifyCreateRepository(doer *user_model.User, u *user_model.User, repo *repo_model.Repository) {
|
||||
}
|
||||
|
||||
// NotifyDeleteRepository places a place holder function
|
||||
func (*NullNotifier) NotifyDeleteRepository(doer *user_model.User, repo *models.Repository) {
|
||||
func (*NullNotifier) NotifyDeleteRepository(doer *user_model.User, repo *repo_model.Repository) {
|
||||
}
|
||||
|
||||
// NotifyForkRepository places a place holder function
|
||||
func (*NullNotifier) NotifyForkRepository(doer *user_model.User, oldRepo, repo *models.Repository) {
|
||||
func (*NullNotifier) NotifyForkRepository(doer *user_model.User, oldRepo, repo *repo_model.Repository) {
|
||||
}
|
||||
|
||||
// NotifyMigrateRepository places a place holder function
|
||||
func (*NullNotifier) NotifyMigrateRepository(doer *user_model.User, u *user_model.User, repo *models.Repository) {
|
||||
func (*NullNotifier) NotifyMigrateRepository(doer *user_model.User, u *user_model.User, repo *repo_model.Repository) {
|
||||
}
|
||||
|
||||
// NotifyPushCommits notifies commits pushed to notifiers
|
||||
func (*NullNotifier) NotifyPushCommits(pusher *user_model.User, repo *models.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) {
|
||||
func (*NullNotifier) NotifyPushCommits(pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) {
|
||||
}
|
||||
|
||||
// NotifyCreateRef notifies branch or tag creation to notifiers
|
||||
func (*NullNotifier) NotifyCreateRef(doer *user_model.User, repo *models.Repository, refType, refFullName string) {
|
||||
func (*NullNotifier) NotifyCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
|
||||
}
|
||||
|
||||
// NotifyDeleteRef notifies branch or tag deletion to notifiers
|
||||
func (*NullNotifier) NotifyDeleteRef(doer *user_model.User, repo *models.Repository, refType, refFullName string) {
|
||||
func (*NullNotifier) NotifyDeleteRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
|
||||
}
|
||||
|
||||
// NotifyRenameRepository places a place holder function
|
||||
func (*NullNotifier) NotifyRenameRepository(doer *user_model.User, repo *models.Repository, oldRepoName string) {
|
||||
func (*NullNotifier) NotifyRenameRepository(doer *user_model.User, repo *repo_model.Repository, oldRepoName string) {
|
||||
}
|
||||
|
||||
// NotifyTransferRepository places a place holder function
|
||||
func (*NullNotifier) NotifyTransferRepository(doer *user_model.User, repo *models.Repository, oldOwnerName string) {
|
||||
func (*NullNotifier) NotifyTransferRepository(doer *user_model.User, repo *repo_model.Repository, oldOwnerName string) {
|
||||
}
|
||||
|
||||
// NotifySyncPushCommits places a place holder function
|
||||
func (*NullNotifier) NotifySyncPushCommits(pusher *user_model.User, repo *models.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) {
|
||||
func (*NullNotifier) NotifySyncPushCommits(pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) {
|
||||
}
|
||||
|
||||
// NotifySyncCreateRef places a place holder function
|
||||
func (*NullNotifier) NotifySyncCreateRef(doer *user_model.User, repo *models.Repository, refType, refFullName string) {
|
||||
func (*NullNotifier) NotifySyncCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
|
||||
}
|
||||
|
||||
// NotifySyncDeleteRef places a place holder function
|
||||
func (*NullNotifier) NotifySyncDeleteRef(doer *user_model.User, repo *models.Repository, refType, refFullName string) {
|
||||
func (*NullNotifier) NotifySyncDeleteRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
|
||||
}
|
||||
|
||||
// NotifyRepoPendingTransfer places a place holder function
|
||||
func (*NullNotifier) NotifyRepoPendingTransfer(doer, newOwner *user_model.User, repo *models.Repository) {
|
||||
func (*NullNotifier) NotifyRepoPendingTransfer(doer, newOwner *user_model.User, repo *repo_model.Repository) {
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue