微信api接口调用-微信群管理
/ * 微信群聊管理 * @author wechatno:tangjinjinwx * @blog http://www.wlkankan.cn */ @Async public void handleMsg(ChannelHandlerContext ctx, TransportMessage vo, String contentJsonStr) {
try {
log.debug(contentJsonStr); ChatRoomActionTaskMessage.Builder bd = ChatRoomActionTaskMessage.newBuilder(); JsonFormat.parser().merge(contentJsonStr, bd); ChatRoomActionTaskMessage req = bd.build(); //将消息转发送给手机客户端 asyncTaskService.msgSend2Phone(ctx, req.getWeChatId(), EnumMsgType.ChatRoomActionTask, vo, req); } catch (Exception e) {
e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL); } } / * 微信群主通过入群申请 * @author wechatno:tangjinjinwx * @blog http://www.wlkankan.cn */ @Async public void handleMsg(ChannelHandlerContext ctx,TransportMessage vo, String contentJsonStr) {
try {
log.debug(contentJsonStr); ChatRoomInviteApproveTaskMessage.Builder bd = ChatRoomInviteApproveTaskMessage.newBuilder(); JsonFormat.parser().merge(contentJsonStr, bd); ChatRoomInviteApproveTaskMessage req = bd.build(); //将消息转发送给手机客户端 asyncTaskService.msgSend2Phone(ctx, req.getWeChatId(), EnumMsgType.ChatRoomInviteApproveTask, vo, req); } catch (Exception e) {
e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL); } } / * 同意微信加入群聊 * @author wechatno:tangjinjinwx * @blog http://www.wlkankan.cn */ @Async public void handleMsg(ChannelHandlerContext ctx,TransportMessage vo, String contentJsonStr) {
try {
log.debug(contentJsonStr); AgreeJoinChatRoomTaskMessage.Builder bd = AgreeJoinChatRoomTaskMessage.newBuilder(); JsonFormat.parser().merge(contentJsonStr, bd); AgreeJoinChatRoomTaskMessage req = bd.build(); asyncTaskService.msgSend2Phone(ctx, req.getWeChatId(), EnumMsgType.AgreeJoinChatRoomTask, vo, req); } catch (Exception e) {
e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL); } }
今天的文章
微信api接口调用-微信群管理分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/bian-cheng-ji-chu/102363.html