feat: update posts

This commit is contained in:
Rogee
2025-05-23 21:21:12 +08:00
parent 92136a8093
commit f370887a71
5 changed files with 68 additions and 100 deletions

View File

@@ -184,7 +184,7 @@ func (ctl *posts) Play(ctx fiber.Ctx, id int64, user *model.Users) (*PlayUrl, er
log.WithError(err).Errorf("GetByID err: %v", err)
return nil, err
}
go model.PostsModel.IncrViewCount(ctx.Context(), post.ID)
go post.IncrViewCount(ctx.Context())
for _, asset := range post.Assets.Data {
if asset.Type == "video/mp4" && asset.Metas != nil && asset.Metas.Short == preview {