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

@ -11,8 +11,8 @@ import (
issues_model "code.gitea.io/gitea/models/issues"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/timeutil"
notify_service "code.gitea.io/gitea/services/notify"
)
// CreateRefComment creates a commit reference comment to issue.
@ -63,7 +63,7 @@ func CreateIssueComment(ctx context.Context, doer *user_model.User, repo *repo_m
return nil, err
}
notification.NotifyCreateIssueComment(ctx, doer, repo, issue, comment, mentions)
notify_service.CreateIssueComment(ctx, doer, repo, issue, comment, mentions)
return comment, nil
}
@ -95,7 +95,7 @@ func UpdateComment(ctx context.Context, c *issues_model.Comment, doer *user_mode
}
}
notification.NotifyUpdateComment(ctx, doer, c, oldContent)
notify_service.UpdateComment(ctx, doer, c, oldContent)
return nil
}
@ -109,7 +109,7 @@ func DeleteComment(ctx context.Context, doer *user_model.User, comment *issues_m
return err
}
notification.NotifyDeleteComment(ctx, doer, comment)
notify_service.DeleteComment(ctx, doer, comment)
return nil
}