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:
@@ -1404,7 +1404,7 @@ type AdminVerificationDetailResponse struct {
|
||||
|
||||
// AdminReviewVerificationRequest 管理端审核认证请求
|
||||
type AdminReviewVerificationRequest struct {
|
||||
Approve bool `json:"approve" binding:"required"`
|
||||
Approve bool `json:"approve"`
|
||||
RejectReason string `json:"reject_reason" binding:"omitempty,max=500"`
|
||||
}
|
||||
|
||||
|
||||
@@ -14,11 +14,13 @@ func ConvertPostImageToResponse(img *model.PostImage) PostImageResponse {
|
||||
return PostImageResponse{}
|
||||
}
|
||||
return 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