diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-19 21:39:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-19 21:39:57 +0800 |
commit | fc3d0826096943b979717ed46c9a4cfd86e06106 (patch) | |
tree | 3143882ccf4dea3a8bf2a0de9c8da9a4efec26ce /models/issue_comment_list.go | |
parent | 7a0347315995b25bcb2dca4786504fb699b5f004 (diff) | |
download | gitea-fc3d0826096943b979717ed46c9a4cfd86e06106.tar.gz gitea-fc3d0826096943b979717ed46c9a4cfd86e06106.zip |
Move attachment into models/repo/ (#17650)
* Move attachment into models/repo/
* Fix test
* Fix bug
Diffstat (limited to 'models/issue_comment_list.go')
-rw-r--r-- | models/issue_comment_list.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/models/issue_comment_list.go b/models/issue_comment_list.go index bd1b48f8e5..3c587fc8f7 100644 --- a/models/issue_comment_list.go +++ b/models/issue_comment_list.go @@ -4,7 +4,10 @@ package models -import "code.gitea.io/gitea/models/db" +import ( + "code.gitea.io/gitea/models/db" + repo_model "code.gitea.io/gitea/models/repo" +) // CommentList defines a list of comments type CommentList []*Comment @@ -393,7 +396,7 @@ func (comments CommentList) loadAttachments(e db.Engine) (err error) { return nil } - attachments := make(map[int64][]*Attachment, len(comments)) + attachments := make(map[int64][]*repo_model.Attachment, len(comments)) commentsIDs := comments.getCommentIDs() left := len(commentsIDs) for left > 0 { @@ -404,13 +407,13 @@ func (comments CommentList) loadAttachments(e db.Engine) (err error) { rows, err := e.Table("attachment"). Join("INNER", "comment", "comment.id = attachment.comment_id"). In("comment.id", commentsIDs[:limit]). - Rows(new(Attachment)) + Rows(new(repo_model.Attachment)) if err != nil { return err } for rows.Next() { - var attachment Attachment + var attachment repo_model.Attachment err = rows.Scan(&attachment) if err != nil { _ = rows.Close() |