微信协议,个人微信api接口
} catch (Exception e) { e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL); } }
} catch (Exception e) { e.printStackTrace(); MessageUtil.sendErrMsg(ctx, EnumErrorCode.InvalidParam, vo.getId(), Constant.ERROR_MSG_DECODFAIL); } }
@Async public void handleMsg(ChannelHandlerContext ctx,TransportMessage vo, String contentJsonStr) { try { log.debug(contentJsonStr); PostSNSNewsTaskMessage.Builder bd = PostSNSNewsTaskMessage.newBuilder(); JsonFormat.parser().merge(contentJsonStr, bd); PostSNSNewsTaskMessage req = bd.build(); //PostSNSNewsTaskMessage req = vo.getContent().unpack(PostSNSNewsTaskMessage.class); asyncTaskService.msgSend2Phone(ctx, req.getWeChatId(), EnumMsgType.PostSNSNewsTask, vo, req); } catch (Exception e) { e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL); } }
5、加好友及通过好友请求