zoukankan      html  css  js  c++  java
  • 企业微信api接口调用-通过手机号或微信好友添加客户

    企业微信SDK接口API调用-通过手机号或微信好友添加客户
    /**
    * 企业微信搜索手机号添加微信
    * @author wechat:happybabby110
    * @blog http://www.wlkankan.cn
    */

    public  void handleMsg(ChannelHandlerContext ctx ,TransportMessage vo, String contentJsonStr) {
        try {
            log.debug(contentJsonStr);
            AddCustomerFromSearchTaskMessage.Builder bd = AddCustomerFromSearchTaskMessage.newBuilder();
            JsonFormat.parser().merge(contentJsonStr, bd);
            AddCustomerFromSearchTaskMessage req = bd.build();
        
            // 将消息转发送给手机客户端
            asyncTaskService.msgSend2Phone(ctx, String.valueOf(req.getWxId()), EnumMsgType.AddCustomerFromSearchTask, vo, req);
    
        } catch (Exception e) {
            e.printStackTrace();
            MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL);
        }
    }
    
    
    /** 
     * 从企业微信好友中添加客户
     * @author wechat:happybabby110
     * @blog http://www.wlkankan.cn
     */
    
    public  void handleMsg(ChannelHandlerContext ctx ,TransportMessage vo, String contentJsonStr) {
        try {
            log.debug(contentJsonStr);
            AddCustomerFromWxTaskMessage.Builder bd = AddCustomerFromWxTaskMessage.newBuilder();
            JsonFormat.parser().merge(contentJsonStr, bd);
            AddCustomerFromWxTaskMessage req = bd.build();
        
            // 将消息转发送给手机客户端
            asyncTaskService.msgSend2Phone(ctx, String.valueOf(req.getWxId()), EnumMsgType.AddCustomerFromWxTask, vo, req);
    
        } catch (Exception e) {
            e.printStackTrace();
            MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL);
        }
    }
  • 相关阅读:
    #Leetcode# 21. Merge Two Sorted Lists
    #Leetcode# 118. Pascal's Triangle
    #LeetCode# 136. Single Number
    #Leetcode# 26. Remove Duplicates from Sorted Array
    #LeetCode# 167. Two Sum II
    #Leetcode# 58. Length of Last Word
    #LeetCode# 35. Search Insert Position
    POJ 2492 J-A Bug's Life
    #Leetcode# 27. Remove Element
    【前端】.easyUI.c#
  • 原文地址:https://www.cnblogs.com/wuliaokankan/p/14137409.html
Copyright © 2011-2022 走看看