Commit 429b0b84 by 李昂

Merge branch 'back_end_dev' of https://gitee.com/LinkWeChat/link-wechat into back_end_dev

2 parents 36d4e1dc 5baf8ea9
......@@ -3,6 +3,8 @@ package com.linkwechat.wecom.domain.dto;
import lombok.Builder;
import lombok.Data;
import java.util.List;
/**
* @author admin
* @date 2020-11-18
......@@ -12,6 +14,8 @@ import lombok.Data;
public class WeWelcomeMsg {
private String welcome_code;
private List attachments;
private Text text;
private Image image;
......
......@@ -157,8 +157,13 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
WeMediaDto weMediaDto = weMaterialService
.uploadTemporaryMaterial(messageMap.getMaterialUrl(), MediaType.IMAGE.getMediaType(),messageMap.getMaterialName());
Optional.ofNullable(weMediaDto).ifPresent(media -> {
weWelcomeMsgBuilder.image(WeWelcomeMsg.Image.builder().media_id(media.getMedia_id())
List attachments = new ArrayList();
JSONObject json = new JSONObject();
json.put("msgtype",weMediaDto.getType());
json.put(weMediaDto.getType(),WeWelcomeMsg.Image.builder().media_id(media.getMedia_id())
.pic_url(media.getUrl()).build());
attachments.add(json);
weWelcomeMsgBuilder.attachments(attachments);
});
}
weCustomerService.sendWelcomeMsg(weWelcomeMsgBuilder.build());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!