init
This commit is contained in:
@@ -3,10 +3,7 @@ package com.ruoyi.yunxin;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.yunxin.client.ImMessageClient;
|
||||
import com.ruoyi.yunxin.config.YunxinProperties;
|
||||
import com.ruoyi.yunxin.req.Option;
|
||||
import com.ruoyi.yunxin.req.SendAttachMsgReq;
|
||||
import com.ruoyi.yunxin.req.SendBatchMsgReq;
|
||||
import com.ruoyi.yunxin.req.SendMsgReq;
|
||||
import com.ruoyi.yunxin.req.*;
|
||||
import com.ruoyi.yunxin.req.type.YxTextData;
|
||||
import com.ruoyi.yunxin.resp.SendMsgResp;
|
||||
import com.ruoyi.yunxin.resp.YxCommonR;
|
||||
@@ -90,4 +87,22 @@ public class Yunxin {
|
||||
return messageClient.sendAttachMsg(sendAttachMsgReq);
|
||||
}
|
||||
|
||||
public YxDataR<YxCommonR> sendBatchAttachMsgNotice(List<Long> toUid, Object data){
|
||||
SendBatchAttachMsgReq req = new SendBatchAttachMsgReq();
|
||||
req.setFromAccid(SYS_NOTICE_ID);
|
||||
req.setToAccids(toUid.stream().map(i -> String.valueOf(toUid)).collect(Collectors.toList()));
|
||||
req.setAttach(JSON.toJSONString(data));
|
||||
return messageClient.sendBatchAttachMsg(req);
|
||||
}
|
||||
|
||||
|
||||
public YxDataR<YxCommonR> sendAttachMsgNotice(Long toUid, Object data){
|
||||
SendAttachMsgReq sendAttachMsgReq = new SendAttachMsgReq();
|
||||
sendAttachMsgReq.setFrom(SYS_NOTICE_ID);
|
||||
sendAttachMsgReq.setTo(toUid+"");
|
||||
sendAttachMsgReq.setAttach(JSON.toJSONString(data));
|
||||
sendAttachMsgReq.setOption(JSON.toJSONString(new Option()));
|
||||
return messageClient.sendAttachMsg(sendAttachMsgReq);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user