yfh преди 2 седмици
родител
ревизия
a1a0fdb988

+ 1 - 1
fs-service/src/main/java/com/fs/im/service/OpenIMService.java

@@ -89,5 +89,5 @@ public interface OpenIMService {
 
     OpenImResponseDTO doctorSendMsgToUser(Long userId,Long doctorId);
 
-    OpenImResponseDTO getFriendApplyList(String userID, int pageNumber, int showNumber);
+    OpenImResponseDTO getFriendList(String userID, int pageNumber, int showNumber,Integer applyType);
 }

+ 30 - 10
fs-service/src/main/java/com/fs/im/service/impl/OpenIMServiceImpl.java

@@ -1634,7 +1634,7 @@ public class OpenIMServiceImpl implements OpenIMService {
     }
 
     @Override
-    public OpenImResponseDTO getFriendApplyList(String userID, int pageNumber, int showNumber) {
+    public OpenImResponseDTO getFriendList(String userID, int pageNumber, int showNumber,Integer applyType) {
         String adminToken = getAdminToken();
         JSONObject jsonObject = new JSONObject();
         Map<String,Object> map = new HashMap<>();
@@ -1642,14 +1642,34 @@ public class OpenIMServiceImpl implements OpenIMService {
         map.put("showNumber", showNumber);
         jsonObject.put("userID",userID);
         jsonObject.put("pagination",map);
-        String body = HttpRequest.post(IMConfig.URL+"/friend/get_friend_apply_list")
-                .header("operationID", String.valueOf(System.currentTimeMillis()))
-                .header("token", adminToken)
-                .body(jsonObject.toString())
-                .execute()
-                .body();
-        OpenImResponseDTO responseDTO= JSONUtil.toBean(body,OpenImResponseDTO.class);
-        return responseDTO;
-
+        if (applyType == 1){
+            String body = HttpRequest.post(IMConfig.URL+"/friend/get_friend_list")
+                    .header("operationID", String.valueOf(System.currentTimeMillis()))
+                    .header("token", adminToken)
+                    .body(jsonObject.toString())
+                    .execute()
+                    .body();
+            OpenImResponseDTO responseDTO= JSONUtil.toBean(body,OpenImResponseDTO.class);
+            return responseDTO;
+        }else if (applyType == 2){
+            String body = HttpRequest.post(IMConfig.URL+"/friend/get_self_friend_apply_list")
+                    .header("operationID", String.valueOf(System.currentTimeMillis()))
+                    .header("token", adminToken)
+                    .body(jsonObject.toString())
+                    .execute()
+                    .body();
+            OpenImResponseDTO responseDTO= JSONUtil.toBean(body,OpenImResponseDTO.class);
+            return responseDTO;
+        }else if (applyType == 3){
+            String body = HttpRequest.post(IMConfig.URL+"/friend/get_friend_apply_list")
+                    .header("operationID", String.valueOf(System.currentTimeMillis()))
+                    .header("token", adminToken)
+                    .body(jsonObject.toString())
+                    .execute()
+                    .body();
+            OpenImResponseDTO responseDTO= JSONUtil.toBean(body,OpenImResponseDTO.class);
+            return responseDTO;
+        }
+        return null;
     }
 }

+ 4 - 4
fs-user-app/src/main/java/com/fs/app/controller/AppLoginController.java

@@ -1033,14 +1033,14 @@ public class AppLoginController extends AppBaseController{
 
 
     /**
-     * 获取收到好友申请列表
+     * 获取好友申请列表
      *
      * @param userRequestParam
      * @return
      */
-    @PostMapping("/getFriendApplyList")
-    public R getFriendApplyList(@RequestBody UserRequestParam userRequestParam)
+    @PostMapping("/getFriendList")
+    public R getFriendList(@RequestBody UserRequestParam userRequestParam)
     {
-       return R.ok().put("date",openIMService.getFriendApplyList(userRequestParam.getUserID(),userRequestParam.getPagination().getPageNumber(),userRequestParam.getPagination().getShowNumber()));
+        return R.ok().put("date",openIMService.getFriendList(userRequestParam.getUserID(),userRequestParam.getPagination().getPageNumber(),userRequestParam.getPagination().getShowNumber(),userRequestParam.getApplyType()));
     }
 }

+ 15 - 20
fs-user-app/src/main/java/com/fs/app/param/UserRequestParam.java

@@ -1,30 +1,25 @@
 package com.fs.app.param;
 
-public class UserRequestParam {
-    private String userID;
-    private Pagination pagination;
+import lombok.Data;
 
-    public UserRequestParam(String userID, Pagination pagination) {
-        this.userID = userID;
-        this.pagination = pagination;
-    }
+@Data
+public class UserRequestParam {
 
-    // Getters and Setters
-    public String getUserID() {
-        return userID;
-    }
+    /**
+     * 会员id
+     */
+    private String userID;
 
-    public void setUserID(String userID) {
-        this.userID = userID;
-    }
+    /**
+     * 好友申请类型
+     */
+    private Integer applyType;
 
-    public Pagination getPagination() {
-        return pagination;
-    }
+    /**
+     * 请求参数
+     */
+    private Pagination pagination;
 
-    public void setPagination(Pagination pagination) {
-        this.pagination = pagination;
-    }
 }