feat(posts): add preview URL fields for post images
All checks were successful
Build Backend / build (push) Successful in 4m45s
Build Backend / build-docker (push) Successful in 1m31s

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:
lafay
2026-04-10 01:13:58 +08:00
parent 539bec6f63
commit 6af6aaa9d0
5 changed files with 57 additions and 28 deletions

View File

@@ -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,
}
}