@@ -85,7 +85,9 @@ func (r *postRepository) ListPostSummaries(clubID uint, limit, offset int) ([]mo
8585 type row struct {
8686 ID uint `gorm:"column:id"`
8787 Title string `gorm:"column:title"`
88+ Content string `gorm:"column:content"`
8889 Type string `gorm:"column:type"`
90+ TypeData string `gorm:"column:type_data"`
8991 IsPinned bool `gorm:"column:is_pinned"`
9092 LikesCount int `gorm:"column:likes_count"`
9193 CommentsCount int `gorm:"column:comments_count"`
@@ -106,7 +108,7 @@ func (r *postRepository) ListPostSummaries(clubID uint, limit, offset int) ([]mo
106108 var rows []row
107109
108110 err := r .db .Table ("posts" ).
109- Select (`posts.id, posts.title, posts.type, posts.is_pinned, posts.likes_count, posts.comments_count, posts.views_count,
111+ Select (`posts.id, posts.title, posts.content, posts. type, posts.type_data , posts.is_pinned, posts.likes_count, posts.comments_count, posts.views_count,
110112 posts.user_id as post_user_id, posts.club_id as post_club_id, posts.created_at, posts.updated_at,
111113 users.id as user_id, users.username as user_username, users.avatar_url as user_avatar_url,
112114 clubs.id as club_id, clubs.name as club_name` ).
@@ -126,7 +128,9 @@ func (r *postRepository) ListPostSummaries(clubID uint, limit, offset int) ([]mo
126128 ps := models.PostSummary {
127129 ID : rrow .ID ,
128130 Title : rrow .Title ,
131+ Content : rrow .Content ,
129132 Type : rrow .Type ,
133+ TypeData : []byte (rrow .TypeData ),
130134 IsPinned : rrow .IsPinned ,
131135 LikesCount : rrow .LikesCount ,
132136 CommentsCount : rrow .CommentsCount ,
0 commit comments