websocket 整合
This commit is contained in:
@@ -26,7 +26,7 @@ public class Agora {
|
||||
}
|
||||
|
||||
|
||||
public List<String> getChannelUsers(String roomId){
|
||||
public List<String> getChannelUsers(Long roomId){
|
||||
String url = "http://api.sd-rtn.com/dev/v1/channel/user/%s/%s";
|
||||
url = String.format(url, agoraProperties.getAppId(), roomId);
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
@@ -42,7 +42,7 @@ public class Agora {
|
||||
return jsonArray.toJavaList(String.class);
|
||||
}
|
||||
|
||||
public void closeChannel(String roomId){
|
||||
public void closeChannel(Long roomId){
|
||||
String url = "http://api.sd-rtn.com/dev/v1/kicking-rule";
|
||||
Map<String,Object> bodyData = new HashMap<>();
|
||||
bodyData.put("appid",agoraProperties.getAppId());
|
||||
|
||||
@@ -11,8 +11,8 @@ public class ImDataRes {
|
||||
public static class ImData {
|
||||
private Integer callType;
|
||||
private Integer status;
|
||||
private String fromUid;
|
||||
private String toUid;
|
||||
private Integer callTime;
|
||||
private Long fromUid;
|
||||
private Long toUid;
|
||||
private Long callTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public class ImMsgGen {
|
||||
* @param to
|
||||
* @param callTime
|
||||
*/
|
||||
public static ImDataRes callNotice(int status,String from,String to,int callTime){
|
||||
public static ImDataRes callNotice(int status,Long from,Long to,long callTime){
|
||||
ImDataRes imDataRes = new ImDataRes();
|
||||
imDataRes.setType(15);
|
||||
ImDataRes.ImData imData = new ImDataRes.ImData();
|
||||
|
||||
@@ -5,7 +5,6 @@ import cn.hutool.core.lang.UUID;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.cai.util.RestTemplateUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -23,7 +22,7 @@ public class Yunxin {
|
||||
private final static String SEND_URL = "https://api.netease.im/nimserver/msg/sendMsg.action";
|
||||
private final static String SEND_ATTR_URL = "https://api.netease.im/nimserver/msg/sendAttachMsg.action";
|
||||
|
||||
public void sendTo(String toUid,Object data,String fromUid){
|
||||
public void sendTo(Long toUid,Object data,Long fromUid){
|
||||
Map<String,Object> option = new HashMap<>();
|
||||
option.put("push",true); // 该消息是否需要APNS推送或安卓系统通知栏推送
|
||||
option.put("roam",false); // 该消息是否需要漫游(需要app开通漫游消息功能)
|
||||
@@ -32,7 +31,7 @@ public class Yunxin {
|
||||
option.put("route",false); // 该消息是否需要抄送第三方 (需要app开通消息抄送功能)
|
||||
|
||||
Map<String,Object> bodyData = new HashMap<>();
|
||||
bodyData.put("from", StringUtils.isBlank(fromUid) ? yunxinProperties.getDefaultFromUid() :fromUid);
|
||||
bodyData.put("from", fromUid == null ? yunxinProperties.getDefaultFromUid() :fromUid);
|
||||
bodyData.put("ope", 0);
|
||||
bodyData.put("to", toUid);
|
||||
bodyData.put("type", 100);
|
||||
@@ -49,7 +48,7 @@ public class Yunxin {
|
||||
RestTemplateUtil.restTemplate.postForObject(SEND_URL,httpEntity, JSONObject.class);
|
||||
}
|
||||
|
||||
public void sendAttachMsg(String toUid,Object data,String fromUid){
|
||||
public void sendAttachMsg(Long toUid,Object data,Long fromUid){
|
||||
Map<String,Object> option = new HashMap<>();
|
||||
option.put("push",true); // 该消息是否需要APNS推送或安卓系统通知栏推送
|
||||
option.put("roam",false); // 该消息是否需要漫游(需要app开通漫游消息功能)
|
||||
@@ -58,7 +57,7 @@ public class Yunxin {
|
||||
option.put("route",false); // 该消息是否需要抄送第三方 (需要app开通消息抄送功能)
|
||||
|
||||
Map<String,Object> bodyData = new HashMap<>();
|
||||
bodyData.put("from", StringUtils.isBlank(fromUid) ? yunxinProperties.getDefaultFromUid() :fromUid);
|
||||
bodyData.put("from", fromUid == null ? yunxinProperties.getDefaultFromUid() :fromUid);
|
||||
bodyData.put("ope", 0);
|
||||
bodyData.put("to", toUid);
|
||||
bodyData.put("type", 100);
|
||||
|
||||
Reference in New Issue
Block a user