|
@@ -1,6 +1,5 @@
|
|
package com.fs.wxwork.service;
|
|
package com.fs.wxwork.service;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
import com.alibaba.fastjson.TypeReference;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.exception.CustomException;
|
|
import com.fs.common.exception.CustomException;
|
|
@@ -16,9 +15,7 @@ import com.fs.wxwork.dto.*;
|
|
import com.fs.wxwork.utils.WxWorkHttpUtil;
|
|
import com.fs.wxwork.utils.WxWorkHttpUtil;
|
|
import com.fs.wxwork.utils.WxWorkHttpUtilNew;
|
|
import com.fs.wxwork.utils.WxWorkHttpUtilNew;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
-import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -51,53 +48,53 @@ public class WxWorkServiceNew {
|
|
public WxWorkResponseDTO<WxWorkInitRespDTO> init(WxWorkInitDTO param,Long serverId) {
|
|
public WxWorkResponseDTO<WxWorkInitRespDTO> init(WxWorkInitDTO param,Long serverId) {
|
|
String url = getUrl(serverId) + "/init";
|
|
String url = getUrl(serverId) + "/init";
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkInitRespDTO>>() {
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkInitRespDTO>>() {
|
|
- });
|
|
|
|
|
|
+ }, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
public WxWorkResponseDTO<WxWorkSendTextMsgRespDTO> SendTextMsg(WxWorkSendTextMsgDTO param,Long serverId) {
|
|
public WxWorkResponseDTO<WxWorkSendTextMsgRespDTO> SendTextMsg(WxWorkSendTextMsgDTO param,Long serverId) {
|
|
String url = getUrl(serverId) + "/SendTextMsg";
|
|
String url = getUrl(serverId) + "/SendTextMsg";
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkSendTextMsgRespDTO>>() {
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkSendTextMsgRespDTO>>() {
|
|
- });
|
|
|
|
|
|
+ }, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
public WxWorkResponseDTO<WxWorkSendAppMsgRespDTO> SendAppMsg(WxWorkSendAppMsgDTO param,Long serverId) {
|
|
public WxWorkResponseDTO<WxWorkSendAppMsgRespDTO> SendAppMsg(WxWorkSendAppMsgDTO param,Long serverId) {
|
|
String url = getUrl(serverId) + "/SendAppMsg";
|
|
String url = getUrl(serverId) + "/SendAppMsg";
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkSendAppMsgRespDTO>>() {
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkSendAppMsgRespDTO>>() {
|
|
- });
|
|
|
|
|
|
+ }, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
public WxWorkResponseDTO<WxwSendLinkMsgRespDTO> SendLinkMsg(WxwSendLinkMsgDTO param,Long serverId) {
|
|
public WxWorkResponseDTO<WxwSendLinkMsgRespDTO> SendLinkMsg(WxwSendLinkMsgDTO param,Long serverId) {
|
|
String url = getUrl(serverId) + "/SendLinkMsg";
|
|
String url = getUrl(serverId) + "/SendLinkMsg";
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendLinkMsgRespDTO>>() {
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendLinkMsgRespDTO>>() {
|
|
- });
|
|
|
|
|
|
+ }, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
public WxWorkResponseDTO<WxwSendCDNImgMsgRespDTO> SendCDNImgMsg(WxwSendCDNImgMsgDTO param,Long serverId) {
|
|
public WxWorkResponseDTO<WxwSendCDNImgMsgRespDTO> SendCDNImgMsg(WxwSendCDNImgMsgDTO param,Long serverId) {
|
|
String url = getUrl(serverId) + "/SendCDNImgMsg";
|
|
String url = getUrl(serverId) + "/SendCDNImgMsg";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendCDNImgMsgRespDTO>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendCDNImgMsgRespDTO>>() {}, serverId);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public WxWorkResponseDTO<WxwSendCDNFileMsgRespDTO> SendCDNFileMsg(WxwSendCDNFileMsgDTO param,Long serverId) {
|
|
public WxWorkResponseDTO<WxwSendCDNFileMsgRespDTO> SendCDNFileMsg(WxwSendCDNFileMsgDTO param,Long serverId) {
|
|
String url = getUrl(serverId) + "/SendCDNFileMsg";
|
|
String url = getUrl(serverId) + "/SendCDNFileMsg";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendCDNFileMsgRespDTO>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendCDNFileMsgRespDTO>>() {}, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
public WxWorkResponseDTO<WxwSendCDNVoiceMsgRespDTO> SendCDNVoiceMsg(WxwSendCDNVoiceMsgDTO param,Long serverId) {
|
|
public WxWorkResponseDTO<WxwSendCDNVoiceMsgRespDTO> SendCDNVoiceMsg(WxwSendCDNVoiceMsgDTO param,Long serverId) {
|
|
String url = getUrl(serverId) + "/SendCDNVoiceMsg";
|
|
String url = getUrl(serverId) + "/SendCDNVoiceMsg";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendCDNVoiceMsgRespDTO>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendCDNVoiceMsgRespDTO>>() {}, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
public WxWorkResponseDTO<WxwSendCDNVideoMsgRespDTO> SendCDNVideoMsg(WxwSendCDNVideoMsgDTO param,Long serverId) {
|
|
public WxWorkResponseDTO<WxwSendCDNVideoMsgRespDTO> SendCDNVideoMsg(WxwSendCDNVideoMsgDTO param,Long serverId) {
|
|
String url = getUrl(serverId) + "/SendCDNVideoMsg";
|
|
String url = getUrl(serverId) + "/SendCDNVideoMsg";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendCDNVideoMsgRespDTO>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendCDNVideoMsgRespDTO>>() {}, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
public WxWorkResponseDTO<WxwSendVideoNumberRespDTO> SendVideoNumber(WxwSendVideoNumberMsgDTO param,Long serverId) {
|
|
public WxWorkResponseDTO<WxwSendVideoNumberRespDTO> SendVideoNumber(WxwSendVideoNumberMsgDTO param,Long serverId) {
|
|
String url = getUrl(serverId) + "/SendVideoNumber";
|
|
String url = getUrl(serverId) + "/SendVideoNumber";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendVideoNumberRespDTO>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendVideoNumberRespDTO>>() {}, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
public String getCorpId(String uuid, Long corpId,Long serverId) {
|
|
public String getCorpId(String uuid, Long corpId,Long serverId) {
|
|
@@ -111,7 +108,7 @@ public class WxWorkServiceNew {
|
|
param.setUuid(uuid);
|
|
param.setUuid(uuid);
|
|
param.setCorpid(corpId);
|
|
param.setCorpid(corpId);
|
|
|
|
|
|
- WxWorkResponseDTO<WxWorkCorpRespDTO> listWxWorkResponseDTO = WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkCorpRespDTO>>() {});
|
|
|
|
|
|
+ WxWorkResponseDTO<WxWorkCorpRespDTO> listWxWorkResponseDTO = WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkCorpRespDTO>>() {}, serverId);
|
|
WxWorkCorpRespDTO data = listWxWorkResponseDTO.getData();
|
|
WxWorkCorpRespDTO data = listWxWorkResponseDTO.getData();
|
|
List<WxWorkCorpRespDTO.CorpInfo> list = data.getList();
|
|
List<WxWorkCorpRespDTO.CorpInfo> list = data.getList();
|
|
if (list != null && !list.isEmpty()) {
|
|
if (list != null && !list.isEmpty()) {
|
|
@@ -134,18 +131,18 @@ public class WxWorkServiceNew {
|
|
public WxWorkResponseDTO<WxwUploadCdnLinkFileRespDTO> uploadCdnLinkFile(WxwUploadCdnLinkFileDTO param, Long serverId) {
|
|
public WxWorkResponseDTO<WxwUploadCdnLinkFileRespDTO> uploadCdnLinkFile(WxwUploadCdnLinkFileDTO param, Long serverId) {
|
|
|
|
|
|
String url = getUrl(serverId) + "/UploadCdnLinkFile";
|
|
String url = getUrl(serverId) + "/UploadCdnLinkFile";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwUploadCdnLinkFileRespDTO>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwUploadCdnLinkFileRespDTO>>() {}, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
public WxWorkResponseDTO<List<WxWorkVid2UserIdRespDTO>> UserId2Vid(WxWorkUserId2VidDTO param,Long serverId) {
|
|
public WxWorkResponseDTO<List<WxWorkVid2UserIdRespDTO>> UserId2Vid(WxWorkUserId2VidDTO param,Long serverId) {
|
|
String url = getUrl(serverId) + "/UserId2Vid";
|
|
String url = getUrl(serverId) + "/UserId2Vid";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<List<WxWorkVid2UserIdRespDTO>>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<List<WxWorkVid2UserIdRespDTO>>>() {}, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
public WxWorkResponseDTO<WxWorkChatIdToRoomIdResp> ChatIdToRoomId(WxWorkChatIdToRoomIdDTO param, Long serverId) {
|
|
public WxWorkResponseDTO<WxWorkChatIdToRoomIdResp> ChatIdToRoomId(WxWorkChatIdToRoomIdDTO param, Long serverId) {
|
|
String url = getUrl(serverId) + "/ChatIdToRoomId";
|
|
String url = getUrl(serverId) + "/ChatIdToRoomId";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkChatIdToRoomIdResp>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkChatIdToRoomIdResp>>() {}, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -157,7 +154,7 @@ public class WxWorkServiceNew {
|
|
|
|
|
|
public WxWorkResponseDTO<WxCdnUploadImgLinkResp> cdnUploadImgLink(WxCdnUploadImgLinkDTO param, Long serverId) {
|
|
public WxWorkResponseDTO<WxCdnUploadImgLinkResp> cdnUploadImgLink(WxCdnUploadImgLinkDTO param, Long serverId) {
|
|
String url = getUrl(serverId) + "/CdnUploadImgLink";
|
|
String url = getUrl(serverId) + "/CdnUploadImgLink";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxCdnUploadImgLinkResp>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxCdnUploadImgLinkResp>>() {}, serverId);
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* CDN上传网络视频
|
|
* CDN上传网络视频
|
|
@@ -168,7 +165,7 @@ public class WxWorkServiceNew {
|
|
|
|
|
|
public WxWorkResponseDTO<WxCdnUploadVideoResp> uploadCdnVideoLink(WxCdnUploadVideoLinkDTO param, Long serverId) {
|
|
public WxWorkResponseDTO<WxCdnUploadVideoResp> uploadCdnVideoLink(WxCdnUploadVideoLinkDTO param, Long serverId) {
|
|
String url = getUrl(serverId) + "/UploadCdnVideoLink";
|
|
String url = getUrl(serverId) + "/UploadCdnVideoLink";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxCdnUploadVideoResp>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxCdnUploadVideoResp>>() {}, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -185,13 +182,13 @@ public class WxWorkServiceNew {
|
|
param.setAuthkey(authkey.getData().getAuthKey());
|
|
param.setAuthkey(authkey.getData().getAuthKey());
|
|
param.setFilekey(authkey.getData().getFilekey());
|
|
param.setFilekey(authkey.getData().getFilekey());
|
|
String url = getUrl(serverId) + "/BigFileUploadLink";
|
|
String url = getUrl(serverId) + "/BigFileUploadLink";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxBigFileUploadLinkResp>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxBigFileUploadLinkResp>>() {}, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
public WxWorkResponseDTO<WxLoginResp> isLogin(WxLoginDTO param, Long serverId) {
|
|
public WxWorkResponseDTO<WxLoginResp> isLogin(WxLoginDTO param, Long serverId) {
|
|
String url = getUrl(serverId) + "/GetRunClientByUuid";
|
|
String url = getUrl(serverId) + "/GetRunClientByUuid";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxLoginResp>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxLoginResp>>() {}, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -202,7 +199,7 @@ public class WxWorkServiceNew {
|
|
*/
|
|
*/
|
|
public WxWorkResponseDTO<WxGetBigAuthkeyResp> getBigAuthkey(WGetBigAuthkeyDTO param, Long serverId) {
|
|
public WxWorkResponseDTO<WxGetBigAuthkeyResp> getBigAuthkey(WGetBigAuthkeyDTO param, Long serverId) {
|
|
String url = getUrl(serverId) + "/GetBigAuthkey";
|
|
String url = getUrl(serverId) + "/GetBigAuthkey";
|
|
- return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxGetBigAuthkeyResp>>() {});
|
|
|
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxGetBigAuthkeyResp>>() {}, serverId);
|
|
}
|
|
}
|
|
|
|
|
|
public void LoginOut(WxWorkGetQrCodeDTO dto, Long serverId) {
|
|
public void LoginOut(WxWorkGetQrCodeDTO dto, Long serverId) {
|