This commit is contained in:
dute7liang
2024-01-29 21:29:17 +08:00
parent e200a7bac3
commit ea111d983e
21 changed files with 399 additions and 14 deletions

View File

@@ -3,6 +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.enums.ImTypeEnum;
import com.ruoyi.yunxin.req.*;
import com.ruoyi.yunxin.req.type.YxTextData;
import com.ruoyi.yunxin.resp.SendMsgResp;
@@ -56,6 +57,18 @@ public class Yunxin {
return messageClient.sendBatchMsg(req);
}
public YxDataR<YxCommonR> batchSendToNotice(List<Long> toUid, Object body, Option option, ImTypeEnum type){
SendBatchMsgReq req = new SendBatchMsgReq();
req.setFromAccid(SYS_NOTICE_ID);
req.setToAccids(toUid.stream().map(i -> String.valueOf(toUid)).collect(Collectors.toList()));
req.setBody(JSON.toJSONString(body));
if(option != null){
req.setOption(JSON.toJSONString(new Option()));
}
req.setType(type.getCode());
return messageClient.sendBatchMsg(req);
}
/**
* 指定用户的自定义消息
*/