From fbc6fc4e835c0249f8d5aaaec71e99d1817f08dd Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期一, 25 十二月 2023 09:18:08 +0800
Subject: [PATCH] 融云
---
ard-work/src/main/java/com/ruoyi/rongcloud/service/Impl/RongCloudServiceImpl.java | 33 ++++++++++-
ard-work/src/main/java/com/ruoyi/rongcloud/service/RongCloudService.java | 4 +
ard-work/src/main/java/com/ruoyi/utils/forest/RongCloudClient.java | 10 ++-
ard-work/src/main/java/com/ruoyi/rongcloud/controller/RongCloudController.java | 18 +++++
ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncTwoParam.java | 12 ++++
ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncEndParam.java | 19 ++++++
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java | 2
ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupUserParam.java | 13 ++++
ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncParam.java | 14 ++++
9 files changed, 117 insertions(+), 8 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/rongcloud/controller/RongCloudController.java b/ard-work/src/main/java/com/ruoyi/rongcloud/controller/RongCloudController.java
index 75c052c..7bbc974 100644
--- a/ard-work/src/main/java/com/ruoyi/rongcloud/controller/RongCloudController.java
+++ b/ard-work/src/main/java/com/ruoyi/rongcloud/controller/RongCloudController.java
@@ -4,6 +4,8 @@
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.rongcloud.param.RongCloudGroupDisParam;
import com.ruoyi.rongcloud.param.RongCloudGroupParam;
+import com.ruoyi.rongcloud.param.RongCloudGroupSyncParam;
+import com.ruoyi.rongcloud.param.RongCloudGroupUserParam;
import com.ruoyi.rongcloud.service.RongCloudService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -85,6 +87,20 @@
@ApiOperation("缇ょ粍绠$悊-鍒锋柊缇ょ粍淇℃伅")
public AjaxResult groupRefresh(@RequestBody RongCloudGroupParam groupParam)
{
- return rongCloudService.groupUserQuery(groupParam);
+ return rongCloudService.groupRefresh(groupParam);
+ }
+
+ @PostMapping("/userGroupQuery")
+ @ApiOperation("缇ょ粍绠$悊-鏌ヨ鐢ㄦ埛鎵�鍦ㄧ兢缁�")
+ public AjaxResult userGroupQuery(@RequestBody RongCloudGroupUserParam userParam)
+ {
+ return rongCloudService.userGroupQuery(userParam);
+ }
+
+ @PostMapping("/groupSync")
+ @ApiOperation("缇ょ粍绠$悊-鍚屾鐢ㄦ埛鎵�鍦ㄧ兢缁�")
+ public AjaxResult groupSync(@RequestBody RongCloudGroupSyncParam syncParam)
+ {
+ return rongCloudService.groupSync(syncParam);
}
}
diff --git a/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncEndParam.java b/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncEndParam.java
new file mode 100644
index 0000000..1921ead
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncEndParam.java
@@ -0,0 +1,19 @@
+package com.ruoyi.rongcloud.param;
+
+import lombok.Data;
+
+/**
+ * @author Administrator
+ */
+@Data
+public class RongCloudGroupSyncEndParam {
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+
+ String userId;
+}
diff --git a/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncParam.java b/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncParam.java
new file mode 100644
index 0000000..5bf6e48
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncParam.java
@@ -0,0 +1,14 @@
+package com.ruoyi.rongcloud.param;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author Administrator
+ */
+@Data
+public class RongCloudGroupSyncParam {
+ String userId;
+ List<RongCloudGroupSyncTwoParam> list;
+}
diff --git a/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncTwoParam.java b/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncTwoParam.java
new file mode 100644
index 0000000..db37868
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupSyncTwoParam.java
@@ -0,0 +1,12 @@
+package com.ruoyi.rongcloud.param;
+
+import lombok.Data;
+
+/**
+ * @author Administrator
+ */
+@Data
+public class RongCloudGroupSyncTwoParam {
+ String groupId;
+ String groupName;
+}
diff --git a/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupUserParam.java b/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupUserParam.java
new file mode 100644
index 0000000..1bd7e26
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/rongcloud/param/RongCloudGroupUserParam.java
@@ -0,0 +1,13 @@
+package com.ruoyi.rongcloud.param;
+
+import lombok.Data;
+
+/**
+ * @author Administrator
+ */
+@Data
+public class RongCloudGroupUserParam {
+ private String userId;
+ private Integer page;
+ private Integer size;
+}
diff --git a/ard-work/src/main/java/com/ruoyi/rongcloud/service/Impl/RongCloudServiceImpl.java b/ard-work/src/main/java/com/ruoyi/rongcloud/service/Impl/RongCloudServiceImpl.java
index e1e767a..11cafea 100644
--- a/ard-work/src/main/java/com/ruoyi/rongcloud/service/Impl/RongCloudServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/rongcloud/service/Impl/RongCloudServiceImpl.java
@@ -7,9 +7,7 @@
import com.ruoyi.rongcloud.mapper.ArdRongGroupMapper;
import com.ruoyi.rongcloud.mapper.ArdRongGroupUserMapper;
import com.ruoyi.rongcloud.domain.*;
-import com.ruoyi.rongcloud.param.RongCloudGroupDisParam;
-import com.ruoyi.rongcloud.param.RongCloudGroupParam;
-import com.ruoyi.rongcloud.param.RongCloudParam;
+import com.ruoyi.rongcloud.param.*;
import com.ruoyi.rongcloud.service.RongCloudService;
import com.ruoyi.utils.forest.RongCloudClient;
import lombok.extern.slf4j.Slf4j;
@@ -18,6 +16,7 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
+import java.lang.reflect.Field;
import java.util.*;
/**
@@ -193,6 +192,34 @@
return AjaxResult.success(groupMap);
}
+ @Override
+ public AjaxResult userGroupQuery(RongCloudGroupUserParam userParam) {
+ return AjaxResult.success(rongCloudClient.userGroupQuery(getRongCloudHead(),userParam));
+ }
+
+ @Override
+ public AjaxResult groupSync(RongCloudGroupSyncParam syncParam) {
+ RongCloudGroupSyncEndParam endParam = new RongCloudGroupSyncEndParam();
+ endParam.setUserId(syncParam.getUserId());
+ List<RongCloudGroupSyncTwoParam> twoParams = syncParam.getList();
+ for (int i = 0; i < twoParams.size(); i++) {
+ RongCloudGroupSyncTwoParam syncTwoParam= twoParams.get(i);
+ String groupId = syncTwoParam.getGroupId();
+ String groupName = syncTwoParam.getGroupName();
+ try {
+ Class clazz = endParam.getClass();
+ // 鍔ㄦ�佹坊鍔犲睘鎬�
+ Field ageField = clazz.getDeclaredField("group["+groupId+"]");
+ ageField.setAccessible(true); // 璁剧疆绉佹湁灞炴�у彲璁块棶
+ ageField.set(endParam, groupName);
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ Map<String, Object> groupMap = rongCloudClient.groupSync(getRongCloudHead(),endParam);
+ return AjaxResult.success(groupMap);
+ }
+
/**
* 鑾峰彇铻嶄簯绛惧悕淇℃伅
*/
diff --git a/ard-work/src/main/java/com/ruoyi/rongcloud/service/RongCloudService.java b/ard-work/src/main/java/com/ruoyi/rongcloud/service/RongCloudService.java
index 049b7be..8b00899 100644
--- a/ard-work/src/main/java/com/ruoyi/rongcloud/service/RongCloudService.java
+++ b/ard-work/src/main/java/com/ruoyi/rongcloud/service/RongCloudService.java
@@ -3,6 +3,8 @@
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.rongcloud.param.RongCloudGroupDisParam;
import com.ruoyi.rongcloud.param.RongCloudGroupParam;
+import com.ruoyi.rongcloud.param.RongCloudGroupSyncParam;
+import com.ruoyi.rongcloud.param.RongCloudGroupUserParam;
import java.util.List;
import java.util.Map;
@@ -26,4 +28,6 @@
AjaxResult groupQuit(RongCloudGroupParam groupParam);
AjaxResult groupUserQuery(RongCloudGroupParam groupId);
AjaxResult groupRefresh(RongCloudGroupParam groupParam);
+ AjaxResult userGroupQuery(RongCloudGroupUserParam userParam);
+ AjaxResult groupSync(RongCloudGroupSyncParam syncParam);
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
index e7fb078..b7e2ef0 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
@@ -215,7 +215,7 @@
/**
* 鑾峰彇鏈寕鎺ユ潈闄愮殑涓変竴杞﹁締
*/
- @PreAuthorize("@ss.hasPermi('sy:syCar:getArdSyCarNoRight')")
+// @PreAuthorize("@ss.hasPermi('sy:syCar:getArdSyCarNoRight')")
@PostMapping("/getArdSyCarNoRight")
@ApiOperation("鑾峰彇鏈寕鎺ユ潈闄愮殑涓変竴杞﹁締")
public Map<String,Object> getArdSyCarNoRight(){
diff --git a/ard-work/src/main/java/com/ruoyi/utils/forest/RongCloudClient.java b/ard-work/src/main/java/com/ruoyi/utils/forest/RongCloudClient.java
index c39ce08..a609152 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/forest/RongCloudClient.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/forest/RongCloudClient.java
@@ -1,9 +1,7 @@
package com.ruoyi.utils.forest;
import com.dtflys.forest.annotation.*;
-import com.ruoyi.rongcloud.param.RongCloudGroupDisParam;
-import com.ruoyi.rongcloud.param.RongCloudGroupParam;
-import com.ruoyi.rongcloud.param.RongCloudParam;
+import com.ruoyi.rongcloud.param.*;
import com.ruoyi.rongcloud.service.MyAddressSource;
import java.util.Map;
@@ -37,4 +35,10 @@
@Post(url = "/group/refresh.json")
Map<String,Object> groupRefresh(@Header Map<String, Object> headerMap, @Body RongCloudGroupParam groupParam);
+
+ @Post(url = "/user/group/query.json")
+ Map<String,Object> userGroupQuery(@Header Map<String, Object> headerMap, @Body RongCloudGroupUserParam userParam);
+
+ @Post(url = "/group/sync.json")
+ Map<String,Object> groupSync(@Header Map<String, Object> headerMap, @Body RongCloudGroupSyncEndParam endParam);
}
--
Gitblit v1.9.3