个人微信api接口调用-微信上线下线通知
/**
* 微信上线通知
* @author wechatno:tangjinjinwx
* @blog http://www.wlkankan.cn
*/
public void handleMsg(ChannelHandlerContext ctx, TransportMessage vo) {
try {
WeChatOnlineNoticeMessage req = vo.getContent().unpack(WeChatOnlineNoticeMessage.class);
log.debug(JsonFormat.printer().print(req));
//1、校验用户信息
if(null != req){
//2、存储微信全局id 与通道
NettyConnectionUtil.registerUserid(req.getWeChatId(),ctx);
WxAccountInfo accountInfo = weChatAccountService.findWeChatAccountInfoByDeviceid(req.getIMEI());
if(null != accountInfo){
//做个保护,如果当前微信号在其他设备上登陆过,就把之前那条记录删除
if(!StringUtils.isBlank(req.getWeChatId()) && !StringUtils.isBlank(req.getIMEI())){
List<WxAccountInfo> list= weChatAccountService.findWeChatAccountInfoByWeChatIdNotEqualsDe