云控微信开发SDK使用教程--手机微信群二维码上传给服务端
云控微信开发SDK使用教程--手机微信群二维码上传给服务端
case PullChatRoomQrCodeTaskResultNotice : {//群二维码
log.debug("socket:msgtype=PullChatRoomQrCodeTaskResultNotice");
pullChatRoomQrCodeTaskResultNoticeHandler.handleMsg(ctx, msgVo);
break;
}
package com.jubotech.framework.netty.handler.socket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.google.protobuf.util.JsonFormat;
import com.jubotech.business.web.domain.AccountInfo;
import com.jubotech.business.web.domain.WeChatAccountInfo;
import com.jubotech.business.web.service.AccountService;
import com.jubotech.business.web.service.WeChatAccountService;
import com.jubotech.framework.netty.common.Constant;
import com.jubotech.framework.netty.utils.MessageUtil;
import com.jubotech.framework.netty.utils.NettyConnectionUtil;
import Jubo.JuLiao.IM.Wx.Proto.PullChatRoomQrCodeTaskResultNotice.PullChatRoomQrCodeTaskResultNoticeMessage;
import Jubo.JuLiao.IM.Wx.Proto.TransportMessageOuterClass.EnumErrorCode;
import Jubo.JuLiao.IM.Wx.Proto.TransportMessageOuterClass.EnumMsgType;
import Jubo.JuLiao.IM.Wx.Proto.TransportMessageOuterClass.TransportMessage;
import io.netty.channel.ChannelHandlerContext;
@Service
public class PullChatRoomQrCodeTaskResultNoticeHandler{
private final Logger log = LoggerFactory.getLogger(getClass());
@Autowired
private WeChatAccountService weChatAccountService;
@Autowired
private AccountService accountService;
/*** 群二维码* @author wechatno:tangjinjinwx* @param ctx* @param vo*/
public void handleMsg(ChannelHandlerContext ctx, TransportMessage vo) {try {PullChatRoomQrCodeTaskResultNoticeMessage req = vo.getContent().unpack(PullChatRoomQrCodeTaskResultNoticeMessage.class);log.info(JsonFormat.printer().print(req));WeChatAccountInfo account = weChatAccountService.findWeChatAccountInfoByWeChatId(req.getWeChatId());if (null != account && null != account.getAccountid() && 1 != account.getIslogined()) {AccountInfo accInfo = accountService.findAccountInfoByid(account.getAccountid());if (null != accInfo) {// 转发给pc端ChannelHandlerContext chx = NettyConnectionUtil.getClientChannelHandlerContextByUserId(accInfo.getAccount());if (null != chx) {MessageUtil.sendJsonMsg(chx, EnumMsgType.PullChatRoomQrCodeTaskResultNotice,NettyConnectionUtil.getNettyId(chx), null, req);}}// 告诉客户端消息已收到MessageUtil.sendMsg(ctx, EnumMsgType.MsgReceivedAck, vo.getAccessToken(), vo.getId(), null);} else {// 对方不在线MessageUtil.sendErrMsg(ctx, EnumErrorCode.TargetNotOnline, Constant.ERROR_MSG_NOTONLINE);}} catch (Exception e) {e.printStackTrace();MessageUtil.sendErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL);}
}
}
项目地址:https://www.wuliaokankan.cn/url301/138.html
接口参考:http://www.yunlauncher.com/Blog/articles/119.html
转载于:https://www.cnblogs.com/wuliaokankan/p/10608090.html
云控微信开发SDK使用教程--手机微信群二维码上传给服务端相关推荐
- 微信群控的服务器怎么用,微信群控开发SDK使用教程--手机客户端返回聊天消息的原始内容给服务端...
微信群控开发SDK使用教程--手机客户端返回聊天消息的原始内容给服务端 case RequestTalkContentTaskResultNotice: {// 返回聊天消息的原始内容 log.deb ...
- 微信开发SDK使用教程--手机微信好友发来聊天消息通知服务端
微信开发SDK使用教程--手机微信好友发来聊天消息通知服务端 case FriendTalkNotice: {// 微信好友发来聊天消息 log.debug("socket:msgtype= ...
- 微信开发SDK使用教程--手机微信个人号新增好友通知服务端
微信开发SDK使用教程--手机微信个人号新增好友通知服务端 case FriendAddNotice: {// 微信个人号新增好友通知 log.debug("socket:msgtype=F ...
- Java 微信开发(四)生成带参数二维码及分享到朋友圈、好友、QQ
微信公众号中的微信分享到朋友圈.分享到QQ.分享到好友功能都是可以帮助营销活动支持的,今天就说一下公众号生成带参数的二维码分享到朋友圈功能 根据微信公众号提供的开发者文档我们可以看出提供的有方法,我们 ...
- 微信小程序 带参数二维码 C# asp.net 服务端程序
第一步 获取access_token: 文档如下: http请求方式: GET https://api.weixin.qq.com/cgi-bin/token?grant_type=client_cr ...
- 通过二维码上传手机文件到服务器
Hello,大家好.这是我的第一篇博客,给大家分享下手机扫码上传图片到服务器实现手机pc同步. 1.自动生成二维码--> 可以去二维码生成工具网站获取api也可以直接用这个:http://qr. ...
- 微信云控开发SDK使用教程--手机机端回传检测清粉好友数通知服务端
微信云控开发SDK使用教程--手机机端回传检测清粉好友数通知服务端 case PostFriendDetectCountNotice : {//手机机端回传检测清粉好友数 log.debug(&quo ...
- 微信二次开发SDK使用教程--手机检测到有人点赞/取消点赞通知服务端
微信二次开发SDK使用教程--手机检测到有人点赞/取消点赞通知服务端 case CircleLikeNotice : {//手机检测到有人点赞/取消点赞通知 log.debug("socke ...
- 微信公众号开发(十)——扫描带参数二维码事件
我们通过微信扫码二维码已经是十分频繁的操作了,为了满足用户渠道推广分析和用户帐号绑定等场景的需要,微信公众平台提供了创建带参数二维码的接口,通过产生的ticket,去获取二维码图片.当用户扫描这个二维 ...
- SNF开发平台WinForm-平板拍照及扫描二维码功能
在我们做项目的时候,经常会有移动平板处理检验,审核等,方便移动办公.这时就需要在现场拍照上传问题,把当场问题进行上传,也有已经拍完照的图片或加工过的图片进行上传.还有在车间现场一体机,工控机 这种产物 ...
最新文章
- tomcat在服务器上改了8080的端口之后所带来的问题
- 【组队学习】【24期】Docker教程
- 微众银行的金融级消息服务平台建设实践和思考
- cocos2d-x的未来展望
- 五天面试 Google、Facebook、Airbnb 等硅谷五家顶级公司,我是如何都拿到 Offer 的
- 设置vmware vsphere web client_Arduino+前端高级应用-通过WEB网页控制Arduino开发板上的LED灯...
- 《剑指offer》变态跳台阶
- dft + fft(模板)
- 不提拔你,就是因为你只想把工作做好
- 包头昆区多大面积_包头地铁“胎死腹中”,何时“卷土重来”?
- 编程语言对比 with
- MySQL 事物的4种隔离级别
- linux 最常用的指令- [readelf][objdump] 读取elf 文件系列
- 阿里云 php shopex,开shopex
- python中re.group()
- AR眼镜,离替代手机还有多远?
- 【NOI2015 Day1】软件包管理器
- department apartment
- Oracle 查询分析器的数据库查询工具。
- 代码精进之路-设计原则