zwhui преди 2 години
родител
ревизия
b1db5103f9

+ 9 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpMsgAuditController.java

@@ -1,6 +1,8 @@
 package com.cyksj.web.controller.manage.corp;
 
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.model.entity.QyMsgContent;
@@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.servlet.http.HttpServletRequest;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 
@@ -89,7 +92,12 @@ public class CorpMsgAuditController {
      */
     @GetMapping("/getMsgByFollowIdAndUserId")
     public Result<SearchResult<QyMsgContent>> getMsgByFollowIdAndUserId(){
-        SearchResult<QyMsgContent> search = beanSearcher.search(QyMsgContent.class, MapUtils.flatBuilder(request.getParameterMap()).build());
+        Map<String, Object> build = MapUtils.flatBuilder(request.getParameterMap()).build();
+        log.info("获取聊天记录 param:{}", JSONUtil.toJsonStr(build));
+        if (!build.containsKey("followId") || !build.containsKey("externalUserid")){
+            throw BusinessRuntimeException.getInstance("缺少必填参数.");
+        }
+        SearchResult<QyMsgContent> search = beanSearcher.search(QyMsgContent.class, build);
         return GatewayResponse.SUCCESS.newBuilder().toResult(search);
     }
 

+ 7 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/WxCorpController.java

@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.snowflake.Sequence;
@@ -307,7 +308,12 @@ public class WxCorpController {
 	 */
 	@GetMapping("/getMsgByFollowIdAndUserId")
 	public Result<SearchResult<QyMsgContent>> getMsgByFollowIdAndUserId() {
-		SearchResult<QyMsgContent> search = beanSearcher.search(QyMsgContent.class, MapUtils.flatBuilder(request.getParameterMap()).build());
+		Map<String, Object> build = MapUtils.flatBuilder(request.getParameterMap()).build();
+		log.info("获取聊天记录 param:{}", JSONUtil.toJsonStr(build));
+		if (!build.containsKey("followId") || !build.containsKey("externalUserid")){
+			throw BusinessRuntimeException.getInstance("缺少必填参数.");
+		}
+		SearchResult<QyMsgContent> search = beanSearcher.search(QyMsgContent.class, build);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}