This commit is contained in:
Leo
2026-01-17 22:31:45 +08:00
parent 3dabd23dd7
commit 88ae4affa4

View File

@@ -214,11 +214,17 @@ public class JDInnerController {
return error("no comment available"); return error("no comment available");
} }
JSONObject item = new JSONObject();
item.put("commentText", commentToUse.getCommentText());
// 解析图片URL并转换webp格式为jpg // 解析图片URL并转换webp格式为jpg
List<String> imageUrls = parsePictureUrls(commentToUse.getPictureUrls()); List<String> imageUrls = parsePictureUrls(commentToUse.getPictureUrls());
List<String> convertedImageUrls = imageConvertService.convertImageUrls(imageUrls); List<String> convertedImageUrls = imageConvertService.convertImageUrls(imageUrls);
// 如果图片列表为空,不返回这个评论
if (convertedImageUrls == null || convertedImageUrls.isEmpty()) {
return error("no comment with images available");
}
JSONObject item = new JSONObject();
item.put("commentText", commentToUse.getCommentText());
item.put("images", convertedImageUrls); item.put("images", convertedImageUrls);
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();