feat(posts): add preview URL fields for post images
Add PreviewURL and PreviewURLLarge fields to PostImage model and responses. Image data now supports format "url|preview_url|preview_url_large" for storing multiple image variants. Also change comment cursor pagination to sort by created_at ASC (oldest first) to display earliest comments as first floor, and make AdminReviewVerificationRequest.Approve field optional.
This commit is contained in:
@@ -256,11 +256,13 @@ func convertPostToAdminListResponse(post *model.Post) dto.AdminPostListResponse
|
||||
images := make([]dto.PostImageResponse, len(post.Images))
|
||||
for i, img := range post.Images {
|
||||
images[i] = dto.PostImageResponse{
|
||||
ID: img.ID,
|
||||
URL: img.URL,
|
||||
ThumbnailURL: img.ThumbnailURL,
|
||||
Width: img.Width,
|
||||
Height: img.Height,
|
||||
ID: img.ID,
|
||||
URL: img.URL,
|
||||
ThumbnailURL: img.ThumbnailURL,
|
||||
PreviewURL: img.PreviewURL,
|
||||
PreviewURLLarge: img.PreviewURLLarge,
|
||||
Width: img.Width,
|
||||
Height: img.Height,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,11 +300,13 @@ func convertPostToAdminDetailResponse(post *model.Post) *dto.AdminPostDetailResp
|
||||
images := make([]dto.PostImageResponse, len(post.Images))
|
||||
for i, img := range post.Images {
|
||||
images[i] = dto.PostImageResponse{
|
||||
ID: img.ID,
|
||||
URL: img.URL,
|
||||
ThumbnailURL: img.ThumbnailURL,
|
||||
Width: img.Width,
|
||||
Height: img.Height,
|
||||
ID: img.ID,
|
||||
URL: img.URL,
|
||||
ThumbnailURL: img.ThumbnailURL,
|
||||
PreviewURL: img.PreviewURL,
|
||||
PreviewURLLarge: img.PreviewURLLarge,
|
||||
Width: img.Width,
|
||||
Height: img.Height,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user