chore(ci, dto): update build workflow and enhance post DTOs
- Added NODE_NO_WARNINGS environment variable to build and deploy workflows. - Upgraded actions/upload-artifact and actions/download-artifact to version 4 in the build workflow. - Introduced ContentEditedAt field in PostResponse and PostDetailResponse DTOs to track content modification timestamps. - Updated post conversion functions to include ContentEditedAt in responses. - Ensured ContentEditedAt is set during post updates in the repository.
This commit is contained in:
@@ -73,6 +73,7 @@ func (r *CommentRepository) Delete(id string) error {
|
||||
UpdateColumns(map[string]interface{}{
|
||||
"comments_count": gorm.Expr("comments_count - 1"),
|
||||
"hot_score": gorm.Expr("likes_count * 2 + (comments_count - 1) * 3 + views_count * 0.1"),
|
||||
"updated_at": gorm.Expr("updated_at"),
|
||||
}).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -102,6 +103,7 @@ func (r *CommentRepository) ApplyPublishedStats(comment *model.Comment) error {
|
||||
UpdateColumns(map[string]any{
|
||||
"comments_count": gorm.Expr("comments_count + 1"),
|
||||
"hot_score": gorm.Expr("likes_count * 2 + (comments_count + 1) * 3 + views_count * 0.1"),
|
||||
"updated_at": gorm.Expr("updated_at"),
|
||||
}).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user