企业微信api接口调用-通过手机号或微信好友添加客户

news/2024/7/20 2:22:41 标签: 小程序, typescript, sdk, unity, wap

企业微信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);
    }
}

http://www.niftyadmin.cn/n/775273.html

相关文章

java 组合与继承

目的:简述 java 中组合与继承 场景:当我们在现在类中需要调用原来类的方法。 组合的方式:在你现在类中创建一个原来类的对象。 public class Test2 {private String aa;private String bb;private Test1 test1; } 继承的方式:…

企业微信api接口调用-触发企业微信推送会话列表

企业微信SDK接口API调用-触发企业微信推送会话列表 /*** 触发企业微信推送会话列表任务* author wechat:happybabby110* blog http://www.wlkankan.cn*/ Async public void handleMsg(ChannelHandlerContext ctx,TransportMessage vo, String contentJsonStr) {try {log.debug…

static 、final、static final 的区别

目的:解释static 、final、static final 的区别 1、加了 final 修饰符,表示这个是最终结果不可被更改的(你尝试改变它的值,编译器就会报错) 2、加了 static 修饰符,表示这是 独一无二 的,只有这…

微信淘宝客查券返利机器人搭建教程分享

微信淘宝客查券返利机器人搭建教程分享 一、登陆淘宝联盟 手机淘宝扫码授权登陆淘宝联盟 地址:https://www.alimama.com 二、配置推广位,获取PID(推荐使用会员PID) 会员推广位PID新增教程 主要目的就是为了获取PID&#xff0…

数据结构/算法题 在线编写/提交的好地方

目的:数据结构/算法题 在线编写/提交的好地方 一直以来都及其的不喜欢做这种算法题。 一来,感觉很浪费时间。(做算法题简单则几十分钟,难得可能七八个小时都不一定解的出来) 二来,也确实是烧脑&#xff0…

response.addheader详解

Response.AddHeader使用实例    1.文件下载,指定默认名    Response.AddHeader("content-type","application/x-msdownload");    Response.AddHeader("Content-Disposition","attachment;filename文件名.rar"); …

母牛的故事 -蓝桥杯算法题

题目描述 有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛? 这个题我做了许久都没有解答出来,主要是思路错了。我一直在考虑这一年…

个人微信开发API协议接口

个人微信开发API协议接口对比 本文对比目前市面上用于微信个人号的所有API协议,主要包括 web版微信协议, ipad协议 , pc微信协议/mac协议 , hook pc版微信 , hook 安卓或者ios版微信 web版微信协议 基本是公开协议&a…