瀏覽代碼

Merge remote-tracking branch 'origin/develop' into develop

yuanliang 1 年之前
父節點
當前提交
ad23eec5cc

+ 18 - 13
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ImUserFriendServiceImpl.java

@@ -274,9 +274,6 @@ public class ImUserFriendServiceImpl extends ServiceImpl<ImUserFriendDao, ImUser
                 customerTitle = MK.IM_SYS_TITLE;
             }
 
-            // 发送消息
-            TxtMessage txtMessage = new TxtMessage(customerMessage, "");
-
             // 拓展消息
             PushExt pushExt = PushExt.build(customerTitle, 1,
                     new PushExt.HW("channelId", "NORMAL"), new PushExt.VIVO("1"),
@@ -286,23 +283,31 @@ public class ImUserFriendServiceImpl extends ServiceImpl<ImUserFriendDao, ImUser
             MessageWrapper.PrivateMessage build = MessageWrapper.PrivateMessage.builder()
                     .senderId(imGroupService.getImUserId(friendIds.get(0).toString(),ClientEnum.TEACHER.getCode()))
                     .targetIds(Lists.newArrayList(imGroupService.getImUserId(userId.toString(),clientType.getCode())))
-                    .objectName(txtMessage.getType())
-                    .rongCloueMessage(txtMessage)
+                    //.objectName(txtMessage.getType())
+                    //.rongCloueMessage(txtMessage)
                     .pushExt(JSON.toJSONString(pushExt))
                     .includeSender(0)
                     .build();
 
 
-            // 腾讯云消息
-            TencentRequest.MessageBody tencentMessages = TencentRequest.MessageBody.builder()
-                    .msgType(ETencentMessage.TIMTextElem.name())
-                    .msgContent(customerMessage)
-                    .build();
-            build.setTencentMessage(tencentMessages);
+            if (TencentCloudImPlugin.PLUGIN_NAME.equals(imPluginContext.defaultService())) {
+                // 腾讯IM消息
+                TencentRequest.MessageBody message = TencentRequest.MessageBody.builder()
+                        .msgType(ETencentMessage.TIMTextElem.name())
+                        .msgContent(TencentRequest.TextMessageBody.builder().text(customerMessage).build())
+                        .build();
 
+                Boolean ret = imPluginContext.getPluginService().sendPrivateMessage(build.objectName(message.getMsgType()).tencentMessage(message));
+                log.info("registerUserBindCustomerService GROUP tencentCloud senderId={}, ret={}", build.getSenderId(), ret);
+            } else {
+                // 融云IM消息
+                TxtMessage message = new TxtMessage(customerMessage, "");
+                Boolean ret = imPluginContext.getPluginService().sendPrivateMessage(build.objectName(message.getType()).rongCloueMessage(message));
+                log.info("registerUserBindCustomerService GROUP rongCloud senderId={}, ret={}", build.getSenderId(), ret);
+            }
 
-            Boolean ret = imPluginContext.getPluginService().sendPrivateMessage(build);
-            log.info("batchSendPrivateMessage GROUP senderId={},data= {} ret={}", userId,build, ret);
+            /*Boolean ret = imPluginContext.getPluginService().sendPrivateMessage(build);
+            log.info("registerUserBindCustomerService GROUP senderId={},data= {} ret={}", userId,build, ret);*/
         } catch (Exception e) {
             log.error("registerUserBindCustomerService userId={}", userId, e);
         }

+ 9 - 6
toolset/thirdparty-component/src/main/java/com/yonge/toolset/thirdparty/user/realname/provider/LinkfaceRealnameAuthenticationPlugin.java

@@ -4,16 +4,18 @@ import java.util.HashMap;
 import java.util.Map;
 
 import com.yonge.toolset.utils.idcard.IdcardValidator;
+import com.alibaba.fastjson.JSONObject;
+import com.yonge.toolset.base.exception.ThirdpartyException;
+import com.yonge.toolset.thirdparty.user.realname.RealnameAuthenticationPlugin;
+import com.yonge.toolset.utils.http.HttpUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
-import com.alibaba.fastjson.JSONObject;
-import com.yonge.toolset.base.exception.ThirdpartyException;
-import com.yonge.toolset.thirdparty.user.realname.RealnameAuthenticationPlugin;
-import com.yonge.toolset.utils.http.HttpUtil;
+import java.util.HashMap;
+import java.util.Map;
 
 @Service
 public class LinkfaceRealnameAuthenticationPlugin implements RealnameAuthenticationPlugin {
@@ -70,10 +72,11 @@ public class LinkfaceRealnameAuthenticationPlugin implements RealnameAuthenticat
     @Override
     public boolean verify(String realname, String idcardNo) {
 
-        IdcardValidator idcardValidator = new IdcardValidator();
+        // 通过身份证号获取身份信息(后续需要改造)
+        /*IdcardValidator idcardValidator = new IdcardValidator();
         if (idcardValidator.isValidatedAllIdcard(idcardNo)) {
             return true;
-        }
+        }*/
 
         String respJson = "";
         HashMap<String, Object> params = new HashMap<String, Object>();