|
@@ -761,35 +761,39 @@ public class StoreCommentAppealServiceImpl extends ServiceImpl<StoreCommentAppea
|
|
|
// 商家图片:暂时传空数组,先测试文本分析流程
|
|
// 商家图片:暂时传空数组,先测试文本分析流程
|
|
|
// TODO: 后续需要将图片转换为Base64
|
|
// TODO: 后续需要将图片转换为Base64
|
|
|
List<String> merchantImages = new ArrayList<>();
|
|
List<String> merchantImages = new ArrayList<>();
|
|
|
- // if (org.springframework.util.StringUtils.hasText(storeCommentAppeal.getImgId())) {
|
|
|
|
|
- // String[] imgIds = storeCommentAppeal.getImgId().split(",");
|
|
|
|
|
- // for (String imgId : imgIds) {
|
|
|
|
|
- // StoreImg storeImg = storeImgMapper.selectById(imgId.trim());
|
|
|
|
|
- // if (storeImg != null && org.springframework.util.StringUtils.hasText(storeImg.getImgUrl())) {
|
|
|
|
|
- // String base64 = convertImageToBase64(storeImg.getImgUrl());
|
|
|
|
|
- // if (org.springframework.util.StringUtils.hasText(base64)) {
|
|
|
|
|
- // merchantImages.add(base64);
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (org.springframework.util.StringUtils.hasText(storeCommentAppeal.getImgId())) {
|
|
|
|
|
+ String[] imgIds = storeCommentAppeal.getImgId().split(",");
|
|
|
|
|
+ for (String imgId : imgIds) {
|
|
|
|
|
+ StoreImg storeImg = storeImgMapper.selectById(imgId.trim());
|
|
|
|
|
+// if (storeImg != null && org.springframework.util.StringUtils.hasText(storeImg.getImgUrl())) {
|
|
|
|
|
+// String base64 = convertImageToBase64(storeImg.getImgUrl());
|
|
|
|
|
+// if (org.springframework.util.StringUtils.hasText(base64)) {
|
|
|
|
|
+// merchantImages.add(base64);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+ if (storeImg.getImgUrl() != null) {
|
|
|
|
|
+ merchantImages.add(storeImg.getImgUrl());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
analyzeRequest.put("merchant_images", merchantImages);
|
|
analyzeRequest.put("merchant_images", merchantImages);
|
|
|
|
|
|
|
|
// 用户图片:暂时传空数组,先测试文本分析流程
|
|
// 用户图片:暂时传空数组,先测试文本分析流程
|
|
|
// TODO: 后续需要将图片转换为Base64
|
|
// TODO: 后续需要将图片转换为Base64
|
|
|
List<String> userImages = new ArrayList<>();
|
|
List<String> userImages = new ArrayList<>();
|
|
|
- // if (org.springframework.util.StringUtils.hasText(rating.getImageUrls())) {
|
|
|
|
|
- // String[] imageUrls = rating.getImageUrls().split(",");
|
|
|
|
|
- // for (String imageUrl : imageUrls) {
|
|
|
|
|
- // String trimmedUrl = imageUrl.trim();
|
|
|
|
|
- // if (org.springframework.util.StringUtils.hasText(trimmedUrl)) {
|
|
|
|
|
- // String base64 = convertImageToBase64(trimmedUrl);
|
|
|
|
|
- // if (org.springframework.util.StringUtils.hasText(base64)) {
|
|
|
|
|
- // userImages.add(base64);
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (org.springframework.util.StringUtils.hasText(rating.getImageUrls())) {
|
|
|
|
|
+ String[] imageUrls = rating.getImageUrls().split(",");
|
|
|
|
|
+ for (String imageUrl : imageUrls) {
|
|
|
|
|
+ String trimmedUrl = imageUrl.trim();
|
|
|
|
|
+// if (org.springframework.util.StringUtils.hasText(trimmedUrl)) {
|
|
|
|
|
+// String base64 = convertImageToBase64(trimmedUrl);
|
|
|
|
|
+// if (org.springframework.util.StringUtils.hasText(base64)) {
|
|
|
|
|
+// userImages.add(base64);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+ userImages.add(trimmedUrl);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
analyzeRequest.put("user_images", userImages);
|
|
analyzeRequest.put("user_images", userImages);
|
|
|
|
|
|
|
|
// 其他字段(可选)
|
|
// 其他字段(可选)
|