Move reaction to models/issues/ (#19264)
* Move reaction to models/issues/ * Fix test * move the function * improve code * Update models/issues/reaction.go Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
43332a483f
commit
d4f84f1c93
18 changed files with 280 additions and 274 deletions
|
@ -18,6 +18,7 @@ import (
|
|||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/models/foreignreference"
|
||||
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/git"
|
||||
|
@ -392,7 +393,7 @@ func (g *GiteaLocalUploader) CreateIssues(issues ...*base.Issue) error {
|
|||
}
|
||||
// add reactions
|
||||
for _, reaction := range issue.Reactions {
|
||||
res := models.Reaction{
|
||||
res := issues_model.Reaction{
|
||||
Type: reaction.Content,
|
||||
CreatedUnix: timeutil.TimeStampNow(),
|
||||
}
|
||||
|
@ -448,7 +449,7 @@ func (g *GiteaLocalUploader) CreateComments(comments ...*base.Comment) error {
|
|||
|
||||
// add reactions
|
||||
for _, reaction := range comment.Reactions {
|
||||
res := models.Reaction{
|
||||
res := issues_model.Reaction{
|
||||
Type: reaction.Content,
|
||||
CreatedUnix: timeutil.TimeStampNow(),
|
||||
}
|
||||
|
@ -646,7 +647,7 @@ func (g *GiteaLocalUploader) newPullRequest(pr *base.PullRequest) (*models.PullR
|
|||
|
||||
// add reactions
|
||||
for _, reaction := range pr.Reactions {
|
||||
res := models.Reaction{
|
||||
res := issues_model.Reaction{
|
||||
Type: reaction.Content,
|
||||
CreatedUnix: timeutil.TimeStampNow(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue