From 7958f1dddb8a7f4e70d232b07a7703955ecedae0 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: 星期六, 26 八月 2023 12:45:33 +0800
Subject: [PATCH] 优化diamante
---
service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoCmd.java | 27 +++++++++++++++++----------
1 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoCmd.java b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoCmd.java
index c0380ec..9308caa 100644
--- a/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoCmd.java
+++ b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoCmd.java
@@ -11,6 +11,7 @@
import com.java110.intf.common.IAdvertInnerServiceSMO;
import com.java110.intf.common.IAdvertItemInnerServiceSMO;
import com.java110.utils.cache.MappingCache;
+import com.java110.utils.constant.MappingConstant;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.StringUtil;
@@ -86,7 +87,7 @@
*/
private void getAdvertItem(List<AdvertDto> advertDtos, JSONArray advertPhotoAndVideos) {
JSONObject photoAndVideo = null;
- String imgUrl = MappingCache.getValue("IMG_PATH");
+ String imgUrl = MappingCache.getValue(MappingConstant.FILE_DOMAIN,"IMG_PATH");
for (AdvertDto advertDto : advertDtos) {
AdvertItemDto advertItemDto = new AdvertItemDto();
@@ -96,16 +97,22 @@
for (AdvertItemDto tmpAdvertItemDto : advertItemDtos) {
//鐓х墖
- if ("8888".equals(tmpAdvertItemDto.getItemTypeCd())) {
- photoAndVideo = new JSONObject();
- photoAndVideo.put("suffix", "JPEG");
- //photoAndVideo.put("url", "/callComponent/download/getFile/file?fileId=" + tmpAdvertItemDto.getUrl() + "&communityId=" + advertDto.getCommunityId());
- photoAndVideo.put("url", imgUrl + tmpAdvertItemDto.getUrl());
- photoAndVideo.put("seq", tmpAdvertItemDto.getSeq());
- photoAndVideo.put("advertType", advertDto.getAdvertType());
- photoAndVideo.put("pageUrl", advertDto.getPageUrl());
- advertPhotoAndVideos.add(photoAndVideo);
+ if (!"8888".equals(tmpAdvertItemDto.getItemTypeCd())) {
+ continue;
}
+
+ photoAndVideo = new JSONObject();
+ photoAndVideo.put("suffix", "JPEG");
+ //photoAndVideo.put("url", "/callComponent/download/getFile/file?fileId=" + tmpAdvertItemDto.getUrl() + "&communityId=" + advertDto.getCommunityId());
+ if(tmpAdvertItemDto.getUrl().startsWith("http")){
+ photoAndVideo.put("url", tmpAdvertItemDto.getUrl());
+ }else{
+ photoAndVideo.put("url", imgUrl + tmpAdvertItemDto.getUrl());
+ }
+ photoAndVideo.put("seq", tmpAdvertItemDto.getSeq());
+ photoAndVideo.put("advertType", advertDto.getAdvertType());
+ photoAndVideo.put("pageUrl", advertDto.getPageUrl());
+ advertPhotoAndVideos.add(photoAndVideo);
}
}
--
Gitblit v1.8.0