Skip to content

Commit

Permalink
fix: 修复搜索帖子时内容显示过多的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Lansongxx committed Apr 15, 2024
1 parent 58633d4 commit cfe3c59
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion biz/infrastructure/convertor/convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,15 @@ func PostMapperToPost(in *postmapper.Post) *gencontent.Post {
if in == nil {
return &gencontent.Post{}
}
text := in.Text
if len(text) > 200 {
text = text[0:200]
}
return &gencontent.Post{
PostId: in.ID.Hex(),
UserId: in.UserId,
Title: in.Title,
Text: in.Text[0:200],
Text: text,
LabelIds: in.LabelIds,
Status: in.Status,
Url: in.Url,
Expand Down

0 comments on commit cfe3c59

Please sign in to comment.