zoukankan      html  css  js  c++  java
  • 抖音api接口调用-同步抖音粉丝列表

    抖音sdk接口API调用-同步抖音粉丝列表

    /**
    * 同步抖音粉丝
    * @author wechat:happybabby110
    * @blog http://www.wlkankan.cn
    */
    @Async
    public void handleMsg(ChannelHandlerContext ctx,TransportMessage vo, String contentJsonStr) {
    try {
    log.debug(contentJsonStr);
    SyncFollowersTaskMessage.Builder bd = SyncFollowersTaskMessage.newBuilder();
    JsonFormat.parser().merge(contentJsonStr, bd);
    SyncFollowersTaskMessage req = bd.build();
    //将消息转发送给手机客户端
    asyncTaskService.msgSend2Phone(ctx, req.getImUid(), EnumMsgType.SyncFollowersTask, vo, req);
    } catch (Exception e) {
    e.printStackTrace();
    MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL);
    }
    }

    /**
    * 推送抖音粉丝
    * @author wechat:happybabby110
    * @blog http://www.wlkankan.cn
    */
    @Async
    public void handleMsg(ChannelHandlerContext ctx, TransportMessage vo) {
    try {
    FollowersPushNoticeMessage req = vo.getContent().unpack(FollowersPushNoticeMessage.class);
    log.debug(JsonFormat.printer().print(req));

            log.debug(LocalDateTime.now()+this.getClass().getName()+"对应的线程名: "+Thread.currentThread().getName());
               
            //消息转发到pc端
            asyncTaskService.msgSend2pc(req.getImUid(), EnumMsgType.FollowersPushNotice, req);
             
            // 告诉客户端消息已收到
            MessageUtil.sendMsg(ctx, EnumMsgType.MsgReceivedAck, vo.getAccessToken(), vo.getId(), null);
             
        } catch (Exception e) {
            e.printStackTrace();
            MessageUtil.sendErrMsg(ctx, EnumErrorCode.InvalidParam,vo.getId(), e.getMessage());
        }
    }
  • 相关阅读:
    多线程与多进程
    Socket网络编程
    Python之路【第五篇】:面向对象及相关
    python 面向对象(进阶篇)
    面向对象
    day1
    day3
    day2
    黑马程序员--C语言中的指针(6)
    黑马程序员--C语言中的指针(5)
  • 原文地址:https://www.cnblogs.com/wuliaokankan/p/14137220.html
Copyright © 2011-2022 走看看