fix(emergency): 推送时封面图相对路径拼接jeecg.path.show前缀为全路径
This commit is contained in:
+12
-1
@@ -26,6 +26,7 @@ import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.global.GlobalUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
@@ -62,6 +63,12 @@ public class FirstAidPushServiceImpl implements IFirstAidPushService {
|
||||
@Autowired
|
||||
private IMHelloApi imHelloApi;
|
||||
|
||||
/**
|
||||
* 文件服务基础URL,用于拼接封面图全路径
|
||||
*/
|
||||
@Value("${jeecg.path.show:}")
|
||||
private String fileBaseUrl;
|
||||
|
||||
@Override
|
||||
public IPage<FirstAidResource> queryResourceList(String orderId, PushFilterDTO filter, Page<FirstAidResource> page) {
|
||||
LambdaQueryWrapper<FirstAidResource> wrapper = buildFilterWrapper(filter);
|
||||
@@ -145,7 +152,11 @@ public class FirstAidPushServiceImpl implements IFirstAidPushService {
|
||||
sendIm.setType(1);
|
||||
sendIm.setTitle(resource.getTitle());
|
||||
sendIm.setContent(StrUtil.isNotBlank(resource.getSummary()) ? resource.getSummary() : resource.getTitle());
|
||||
sendIm.setMessageImageUrl(resource.getCoverImage());
|
||||
String coverImage = resource.getCoverImage();
|
||||
if (StrUtil.isNotBlank(coverImage) && !coverImage.startsWith("http")) {
|
||||
coverImage = StrUtil.removeSuffix(fileBaseUrl, "/") + "/" + StrUtil.removePrefix(coverImage, "/");
|
||||
}
|
||||
sendIm.setMessageImageUrl(coverImage);
|
||||
|
||||
ImGroupMsgTextReqDO im = new ImGroupMsgTextReqDO();
|
||||
im.setGroupId(order.getSessionId());
|
||||
|
||||
Reference in New Issue
Block a user