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:
@@ -60,6 +60,8 @@ type Post struct {
|
||||
// 时间戳
|
||||
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime;index:idx_posts_status_created,priority:2,sort:desc;index:idx_posts_user_status_created,priority:3,sort:desc;index:idx_posts_hot_score_created,priority:2,sort:desc"`
|
||||
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime:false"`
|
||||
// ContentEditedAt 仅在实际修改标题/正文/图片时更新,供前端展示「已编辑」;与统计类更新解耦
|
||||
ContentEditedAt *time.Time `json:"content_edited_at,omitempty" gorm:"column:content_edited_at"`
|
||||
}
|
||||
|
||||
// BeforeCreate 创建前生成UUID
|
||||
|
||||
Reference in New Issue
Block a user