|
@@ -1,15 +1,24 @@
|
|
|
package com.fs.wxwork.service;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.common.exception.CustomException;
|
|
|
+import com.fs.ipad.param.WxGetSessionRoomListParam;
|
|
|
+import com.fs.ipad.param.WxRoomUserListParam;
|
|
|
+import com.fs.ipad.param.WxSendAtMsgParam;
|
|
|
+import com.fs.ipad.vo.WxGetSessionRoomListVo;
|
|
|
+import com.fs.ipad.vo.WxRoomUserListVo;
|
|
|
+import com.fs.ipad.vo.WxSendAtMsgVo;
|
|
|
import com.fs.qw.domain.QwIpadServer;
|
|
|
import com.fs.qw.service.IQwIpadServerService;
|
|
|
import com.fs.wxwork.dto.*;
|
|
|
import com.fs.wxwork.utils.WxWorkHttpUtil;
|
|
|
import com.fs.wxwork.utils.WxWorkHttpUtilNew;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -30,7 +39,7 @@ public class WxWorkServiceNew {
|
|
|
if (url != null && !url.isEmpty()) {
|
|
|
return url;
|
|
|
}
|
|
|
- System.out.println("serverId:" + serverId);
|
|
|
+ log.info("serverId:" + serverId);
|
|
|
QwIpadServer qwIpadServer = qwIpadServerService.selectQwIpadServerById(serverId);
|
|
|
if (qwIpadServer == null||qwIpadServer.getUrl()==null) {
|
|
|
throw new CustomException("未获取到服务地址与端口");
|
|
@@ -51,20 +60,20 @@ public class WxWorkServiceNew {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
public WxWorkResponseDTO<WxWorkSendAppMsgRespDTO> SendAppMsg(WxWorkSendAppMsgDTO param,Long serverId) {
|
|
|
String url = getUrl(serverId) + "/SendAppMsg";
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkSendAppMsgRespDTO>>() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
public WxWorkResponseDTO<WxwSendLinkMsgRespDTO> SendLinkMsg(WxwSendLinkMsgDTO param,Long serverId) {
|
|
|
String url = getUrl(serverId) + "/SendLinkMsg";
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendLinkMsgRespDTO>>() {
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public WxWorkResponseDTO<WxwSendCDNImgMsgRespDTO> SendCDNImgMsg(WxwSendCDNImgMsgDTO param,Long serverId) {
|
|
|
String url = getUrl(serverId) + "/SendCDNImgMsg";
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendCDNImgMsgRespDTO>>() {});
|
|
@@ -80,12 +89,17 @@ public class WxWorkServiceNew {
|
|
|
String url = getUrl(serverId) + "/SendCDNVoiceMsg";
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendCDNVoiceMsgRespDTO>>() {});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public WxWorkResponseDTO<WxwSendCDNVideoMsgRespDTO> SendCDNVideoMsg(WxwSendCDNVideoMsgDTO param,Long serverId) {
|
|
|
String url = getUrl(serverId) + "/SendCDNVideoMsg";
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendCDNVideoMsgRespDTO>>() {});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ public WxWorkResponseDTO<WxwSendVideoNumberRespDTO> SendVideoNumber(WxwSendVideoNumberMsgDTO param,Long serverId) {
|
|
|
+ String url = getUrl(serverId) + "/SendVideoNumber";
|
|
|
+ return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwSendVideoNumberRespDTO>>() {});
|
|
|
+ }
|
|
|
+
|
|
|
public String getCorpId(String uuid, Long corpId,Long serverId) {
|
|
|
String sCorpId = redisCache.getCacheObject("ipad:corpId:" + corpId);
|
|
|
if (sCorpId != null&& !sCorpId.isEmpty()) {
|
|
@@ -108,7 +122,7 @@ public class WxWorkServiceNew {
|
|
|
String scorpId = corpInfo.getScorp_id();
|
|
|
|
|
|
if (scorpId!=null&&!scorpId.isEmpty()) {
|
|
|
- redisCache.setCacheObject("ipad:corpId:" + corpId,scorpId);
|
|
|
+ redisCache.setCacheObject("ipad:corpId:" + corpId,scorpId);
|
|
|
|
|
|
return scorpId;
|
|
|
}
|
|
@@ -116,19 +130,19 @@ public class WxWorkServiceNew {
|
|
|
|
|
|
return "";
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public WxWorkResponseDTO<WxwUploadCdnLinkFileRespDTO> uploadCdnLinkFile(WxwUploadCdnLinkFileDTO param, Long serverId) {
|
|
|
|
|
|
String url = getUrl(serverId) + "/UploadCdnLinkFile";
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxwUploadCdnLinkFileRespDTO>>() {});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public WxWorkResponseDTO<List<WxWorkVid2UserIdRespDTO>> UserId2Vid(WxWorkUserId2VidDTO param,Long serverId) {
|
|
|
String url = getUrl(serverId) + "/UserId2Vid";
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<List<WxWorkVid2UserIdRespDTO>>>() {});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
public WxWorkResponseDTO<WxWorkChatIdToRoomIdResp> ChatIdToRoomId(WxWorkChatIdToRoomIdDTO param, Long serverId) {
|
|
|
String url = getUrl(serverId) + "/ChatIdToRoomId";
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkChatIdToRoomIdResp>>() {});
|
|
@@ -140,7 +154,7 @@ public class WxWorkServiceNew {
|
|
|
* @param serverId 服务器ID
|
|
|
* @return WxWorkResponseDTO
|
|
|
*/
|
|
|
-
|
|
|
+
|
|
|
public WxWorkResponseDTO<WxCdnUploadImgLinkResp> cdnUploadImgLink(WxCdnUploadImgLinkDTO param, Long serverId) {
|
|
|
String url = getUrl(serverId) + "/CdnUploadImgLink";
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxCdnUploadImgLinkResp>>() {});
|
|
@@ -151,7 +165,7 @@ public class WxWorkServiceNew {
|
|
|
* @param serverId 服务器ID
|
|
|
* @return WxWorkResponseDTO
|
|
|
*/
|
|
|
-
|
|
|
+
|
|
|
public WxWorkResponseDTO<WxCdnUploadVideoResp> uploadCdnVideoLink(WxCdnUploadVideoLinkDTO param, Long serverId) {
|
|
|
String url = getUrl(serverId) + "/UploadCdnVideoLink";
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxCdnUploadVideoResp>>() {});
|
|
@@ -163,7 +177,7 @@ public class WxWorkServiceNew {
|
|
|
* @param serverId 服务器ID
|
|
|
* @return WxWorkResponseDTO
|
|
|
*/
|
|
|
-
|
|
|
+
|
|
|
public WxWorkResponseDTO<WxBigFileUploadLinkResp> bigFileUploadLink(WxBigFileUploadLinkDTO param, Long serverId) {
|
|
|
WGetBigAuthkeyDTO dto = new WGetBigAuthkeyDTO();
|
|
|
dto.setUuid(param.getUuid());
|
|
@@ -174,7 +188,7 @@ public class WxWorkServiceNew {
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxBigFileUploadLinkResp>>() {});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
public WxWorkResponseDTO<WxLoginResp> isLogin(WxLoginDTO param, Long serverId) {
|
|
|
String url = getUrl(serverId) + "/GetRunClientByUuid";
|
|
|
return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxLoginResp>>() {});
|
|
@@ -193,6 +207,21 @@ public class WxWorkServiceNew {
|
|
|
|
|
|
public void LoginOut(WxWorkGetQrCodeDTO dto, Long serverId) {
|
|
|
String url = getUrl(serverId) + "/LoginOut";
|
|
|
- log.info("退出登录:{}, serverID:{}", dto, serverId);
|
|
|
WxWorkHttpUtil.postWithType(url, dto, new TypeReference<WxWorkResponseDTO<WxwLoginOutRespDTO>>() {});
|
|
|
- }}
|
|
|
+ }
|
|
|
+
|
|
|
+ public WxWorkResponseDTO<WxGetSessionRoomListVo> getSessionRoomList(WxGetSessionRoomListParam param, Long serverId) {
|
|
|
+ String url = getUrl(serverId) + "/GetSessionRoomList";
|
|
|
+ return WxWorkHttpUtil.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxGetSessionRoomListVo>>() {});
|
|
|
+ }
|
|
|
+
|
|
|
+ public WxWorkResponseDTO<WxRoomUserListVo> getRoomUserList(WxRoomUserListParam param, Long serverId) {
|
|
|
+ String url = getUrl(serverId) + "/GetRoomUserList";
|
|
|
+ return WxWorkHttpUtil.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxRoomUserListVo>>() {});
|
|
|
+ }
|
|
|
+
|
|
|
+ public WxWorkResponseDTO<WxSendAtMsgVo> sendTextAtMsg(WxSendAtMsgParam param, Long serverId) {
|
|
|
+ String url = getUrl(serverId) + "/SendTextAtMsg";
|
|
|
+ return WxWorkHttpUtil.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxSendAtMsgVo>>() {});
|
|
|
+ }
|
|
|
+}
|