出售本站【域名】【外链】

首页 AI人工智能软件 qqAI人工智能 微信AI人工智能 抖音AI人工智能 快手AI人工智能 云控系统 手机AI人工智能

抖音聚合聊天API接口,抖音云控客服SDK调用源码

2024-02-09

抖音聚折聊天API接口,抖音云控客服SDK挪用源码

原文已参取新人创做礼流动,一起开启掘金创做之路。

/** * 抖音上线通知 * @author wechat:happybabby110 * @blog */ public ZZZoid handleMsg(ChannelHandlerContext ctx, TransportMessage ZZZo) { try { ImOnlineNoticeMessage req = ZZZo.getContent().unpack(ImOnlineNoticeMessage.class); log.debug(JsonFormat.printer().print(req)); //1、校验用户信息 if(null != req){ //2、存储全局id 取通道 NettyConnectionUtil.registerUserid(req.getImUid(),ctx); DeZZZiceInfo deZZZice = deZZZiceSerZZZice.getByDeZZZiceid(req.getImei()); if(null != deZZZice){ //作个护卫,假如当前微信号正在其余方法上登陆过,就把之前这条记录增除 if(!StringUtils.isBlank(req.getImUid()) && !StringUtils.isBlank(req.getImei())){ if(!StringUtils.isEmpty(deZZZice.getImuid()) && !req.getImUid().equals(deZZZice.getImuid())){ deZZZice.setAZZZatar(""); deZZZice.setImuid(""); deZZZice.setNickname(""); deZZZice.setIsonline(1); deZZZiceSerZZZice.update(deZZZice); } } //设置新的参数 deZZZice.setImuid(req.getImUid()); deZZZice.setNickname(req.getNickName()); deZZZice.setAZZZatar(req.getAZZZatar()); deZZZice.setGender(req.getGenderValue()); deZZZice.setPhone(req.getPhone()); deZZZice.setUniqueid(req.getUniqueId()); deZZZice.setProZZZince(req.getProZZZince()); deZZZice.setCity(req.getCity()); //改为上线形态 deZZZice.setIsonline(0);//上线 deZZZiceSerZZZice.update(deZZZice); //3、讲述客户端音讯已支到 MessageUtil.sendMsg(ctx, EnumMsgType.MsgReceiZZZedAck, ZZZo.getAccessToken(), ZZZo.getId(), null); asyncTaskSerZZZice.msgSend2pc(req.getImUid(), EnumMsgType.ImOnlineNotice, req); } } } catch (Exception e) { e.printStackTrace(); MessageUtil.sendErrMsg(ctx, EnumErrorCode.InZZZalidParam,ZZZo.getId(), e.getMessage()); } } /** * 抖音下线通知 * @author wechat:happybabby110 * @blog */ public ZZZoid handleMsg(ChannelHandlerContext ctx, TransportMessage ZZZo) {undefined try {undefined ImOfflineNoticeMessage req = ZZZo.getContent().unpack(ImOfflineNoticeMessage.class); log.debug(JsonFormat.printer().print(req)); if (null != req) {undefined // 把音讯转发给pc端 DeZZZiceInfo account = deZZZiceSerZZZice.getByImUid(req.getImUid()); if (null != account) {undefined account.setIsonline(1);// 下线 deZZZiceSerZZZice.update(account); asyncTaskSerZZZice.msgSend2pc(req.getImUid(), EnumMsgType.ImOfflineNotice, req); } // 3、讲述客户端音讯已支到 MessageUtil.sendMsg(ctx, EnumMsgType.MsgReceiZZZedAck, ZZZo.getAccessToken(), ZZZo.getId(), null); } else { MessageUtil.sendErrMsg(ctx, EnumErrorCode.InZZZalidParam, ZZZo.getId(), Constant.ERROR_MSG_ILLEGALDEVICE); } } catch (Exception e) { e.printStackTrace(); MessageUtil.sendErrMsg(ctx, EnumErrorCode.InZZZalidParam, ZZZo.getId(), Constant.ERROR_MSG_DECODFAIL); } } 2、抖音粉丝或摰友支发音讯 /** * 给抖音粉丝或摰友发音讯 * @author wechat:happybabby110 * @blog */ @Async public ZZZoid handleMsg(ChannelHandlerContext ctx,TransportMessage ZZZo, String contentJsonStr) {undefined try {undefined log.debug(contentJsonStr); TalkToFriendTaskMessage.Builder bd = TalkToFriendTaskMessage.newBuilder(); JsonFormat.parser().merge(contentJsonStr, bd); TalkToFriendTaskMessage req = bd.build(); //将音讯转发送给手机客户端 asyncTaskSerZZZice.msgSend2Phone(ctx, req.getImUid(), EnumMsgType.TalkToFriendTask, ZZZo, req); } catch (Exception e) {undefined e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InZZZalidParam, Constant.ERROR_MSG_DECODFAIL); } } /** * 抖音聊天音讯真时推送 * @author wechat:happybabby110 * @blog */ @Async public ZZZoid handleMsg(ChannelHandlerContext ctx, TransportMessage ZZZo) {undefined try {undefined ChatMsgNoticeMessage req = ZZZo.getContent().unpack(ChatMsgNoticeMessage.class); log.debug(JsonFormat.printer().print(req)); log.debug(LocalDateTime.now()+" ChatMsgNoticeMessage 对应的线程名: "+Thread.currentThread().getName()); //音讯转发到pc端 asyncTaskSerZZZice.msgSend2pc(req.getImUid(), EnumMsgType.ChatMsgNotice, req); // 讲述客户端音讯已支到 MessageUtil.sendMsg(ctx, EnumMsgType.MsgReceiZZZedAck, ZZZo.getAccessToken(), ZZZo.getId(), null); } catch (Exception e) { e.printStackTrace(); MessageUtil.sendErrMsg(ctx, EnumErrorCode.InZZZalidParam,ZZZo.getId(), e.getMessage()); } } 3、关注取撤消关注抖音号 /** * @author wechat:happybabby110 * @blog * 关注抖音号 */ @Async public ZZZoid handleMsg(ChannelHandlerContext ctx,TransportMessage ZZZo, String contentJsonStr) {undefined try {undefined log.debug(contentJsonStr); FollowTaskMessage.Builder bd = FollowTaskMessage.newBuilder(); JsonFormat.parser().merge(contentJsonStr, bd); FollowTaskMessage req = bd.build(); //将音讯转发送给手机客户端 asyncTaskSerZZZice.msgSend2Phone(ctx, req.getImUid(), EnumMsgType.FollowTask, ZZZo, req); } catch (Exception e) {undefined e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InZZZalidParam, Constant.ERROR_MSG_DECODFAIL); } } /** * 撤消关注抖音号 * @author wechat:happybabby110 * @blog */ @Async public ZZZoid handleMsg(ChannelHandlerContext ctx,TransportMessage ZZZo, String contentJsonStr) {undefined try {undefined log.debug(contentJsonStr); UnFollowTaskMessage.Builder bd = UnFollowTaskMessage.newBuilder(); JsonFormat.parser().merge(contentJsonStr, bd); UnFollowTaskMessage req = bd.build(); //将音讯转发送给手机客户端 asyncTaskSerZZZice.msgSend2Phone(ctx, req.getImUid(), EnumMsgType.UnFollowTask, ZZZo, req); } catch (Exception e) {undefined e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InZZZalidParam, Constant.ERROR_MSG_DECODFAIL); } } 4、同步抖音引荐的摰友 /** * 同步抖音引荐的摰友 * @author wechat:happybabby110 * @blog */ @Async public ZZZoid handleMsg(ChannelHandlerContext ctx,TransportMessage ZZZo, String contentJsonStr) {undefined try {undefined log.debug(contentJsonStr); SyncRecFriendsTaskMessage.Builder bd = SyncRecFriendsTaskMessage.newBuilder(); JsonFormat.parser().merge(contentJsonStr, bd); SyncRecFriendsTaskMessage req = bd.build(); //将音讯转发送给手机客户端 asyncTaskSerZZZice.msgSend2Phone(ctx, req.getImUid(), EnumMsgType.SyncRecFriendsTask, ZZZo, req); } catch (Exception e) {undefined e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InZZZalidParam, Constant.ERROR_MSG_DECODFAIL); } } /** * 推送抖音引荐的摰友 * @author wechat:happybabby110 * @blog */ @Async public ZZZoid handleMsg(ChannelHandlerContext ctx, TransportMessage ZZZo) {undefined try {undefined RecFriendsPushNoticeMessage req = ZZZo.getContent().unpack(RecFriendsPushNoticeMessage.class); log.debug(JsonFormat.printer().print(req)); log.debug(LocalDateTime.now()+" RecFriendsPushNoticeMessage 对应的线程名: "+Thread.currentThread().getName()); //音讯转发到pc端 asyncTaskSerZZZice.msgSend2pc(req.getImUid(), EnumMsgType.RecFriendsPushNotice, req); // 讲述客户端音讯已支到 MessageUtil.sendMsg(ctx, EnumMsgType.MsgReceiZZZedAck, ZZZo.getAccessToken(), ZZZo.getId(), null); } catch (Exception e) { e.printStackTrace(); MessageUtil.sendErrMsg(ctx, EnumErrorCode.InZZZalidParam,ZZZo.getId(), e.getMessage()); } } 5、同步抖音聊天会话列表 /** * 同步抖音会话列表 * @author wechat:happybabby110 * @blog */ @Async public ZZZoid handleMsg(ChannelHandlerContext ctx,TransportMessage ZZZo, String contentJsonStr) {undefined try {undefined log.debug(contentJsonStr); SyncConZZZersationTaskMessage.Builder bd = SyncConZZZersationTaskMessage.newBuilder(); JsonFormat.parser().merge(contentJsonStr, bd); SyncConZZZersationTaskMessage req = bd.build(); //将音讯转发送给手机客户端 asyncTaskSerZZZice.msgSend2Phone(ctx, req.getImUid(), EnumMsgType.SyncConZZZersationTask, ZZZo, req); } catch (Exception e) {undefined e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InZZZalidParam, Constant.ERROR_MSG_DECODFAIL); } } /** * 推送抖音会话列表 * @author wechat:happybabby110 * @blog */ @Async public ZZZoid handleMsg(ChannelHandlerContext ctx, TransportMessage ZZZo) {undefined try {undefined ConZZZersationPushNoticeMessage req = ZZZo.getContent().unpack(ConZZZersationPushNoticeMessage.class); log.debug(JsonFormat.printer().print(req)); log.debug(LocalDateTime.now()+" ConZZZersationPushNoticeMessage 对应的线程名: "+Thread.currentThread().getName()); //音讯转发到pc端 asyncTaskSerZZZice.msgSend2pc(req.getImUid(), EnumMsgType.ConZZZersationPushNotice, req); // 讲述客户端音讯已支到 MessageUtil.sendMsg(ctx, EnumMsgType.MsgReceiZZZedAck, ZZZo.getAccessToken(), ZZZo.getId(), null); } catch (Exception e) { e.printStackTrace(); MessageUtil.sendErrMsg(ctx, EnumErrorCode.InZZZalidParam,ZZZo.getId(), e.getMessage()); } } demo地址: 6、同步抖音粉丝列表 /** * 同步抖音粉丝 * @author wechat:happybabby110 * @blog */ @Async public ZZZoid handleMsg(ChannelHandlerContext ctx,TransportMessage ZZZo, String contentJsonStr) {undefined try {undefined log.debug(contentJsonStr); SyncFollowersTaskMessage.Builder bd = SyncFollowersTaskMessage.newBuilder(); JsonFormat.parser().merge(contentJsonStr, bd); SyncFollowersTaskMessage req = bd.build(); //将音讯转发送给手机客户端 asyncTaskSerZZZice.msgSend2Phone(ctx, req.getImUid(), EnumMsgType.SyncFollowersTask, ZZZo, req); } catch (Exception e) {undefined e.printStackTrace(); MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InZZZalidParam, Constant.ERROR_MSG_DECODFAIL); } } /** * 推送抖音粉丝 * @author wechat:happybabby110 * @blog */ @Async public ZZZoid handleMsg(ChannelHandlerContext ctx, TransportMessage ZZZo) {undefined try {undefined FollowersPushNoticeMessage req = ZZZo.getContent().unpack(FollowersPushNoticeMessage.class); log.debug(JsonFormat.printer().print(req)); log.debug(LocalDateTime.now()+this.getClass().getName()+"对应的线程名: "+Thread.currentThread().getName()); //音讯转发到pc端 asyncTaskSerZZZice.msgSend2pc(req.getImUid(), EnumMsgType.FollowersPushNotice, req); // 讲述客户端音讯已支到 MessageUtil.sendMsg(ctx, EnumMsgType.MsgReceiZZZedAck, ZZZo.getAccessToken(), ZZZo.getId(), null); } catch (Exception e) { e.printStackTrace(); MessageUtil.sendErrMsg(ctx, EnumErrorCode.InZZZalidParam,ZZZo.getId(), e.getMessage()); } }

热门文章

友情链接: 永康物流网 本站外链出售 义乌物流网 本网站域名出售 手机靓号-号码网