mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-16 15:51:14 +00:00
Add replies field to CommentView and update logic to fetch comment replies
This commit is contained in:
@@ -25,13 +25,14 @@ const (
|
||||
)
|
||||
|
||||
type CommentView struct {
|
||||
ID uint `json:"id"`
|
||||
Content string `json:"content"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
User UserView `json:"user"`
|
||||
Images []ImageView `json:"images"`
|
||||
ReplyCount uint `json:"reply_count"`
|
||||
ContentTruncated bool `json:"content_truncated"`
|
||||
ID uint `json:"id"`
|
||||
Content string `json:"content"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
User UserView `json:"user"`
|
||||
Images []ImageView `json:"images"`
|
||||
ReplyCount uint `json:"reply_count"`
|
||||
ContentTruncated bool `json:"content_truncated"`
|
||||
Replies []CommentView `json:"replies,omitempty"`
|
||||
}
|
||||
|
||||
func (c *Comment) ToView() *CommentView {
|
||||
|
||||
Reference in New Issue
Block a user