抖音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);
        FollowTaskMessage.Builder bd = FollowTaskMessage.newBuilder();
        JsonFormat.parser().merge(contentJsonStr, bd);
        FollowTaskMessage req = bd.build();
        //將消息轉發送給手機客戶端
        asyncTaskService.msgSend2Phone(ctx, req.getImUid(), EnumMsgType.FollowTask, 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, String contentJsonStr) {
    try {
        log.debug(contentJsonStr);
        UnFollowTaskMessage.Builder bd = UnFollowTaskMessage.newBuilder();
        JsonFormat.parser().merge(contentJsonStr, bd);
        UnFollowTaskMessage req = bd.build();
        //將消息轉發送給手機客戶端
        asyncTaskService.msgSend2Phone(ctx, req.getImUid(), EnumMsgType.UnFollowTask, vo, req);
    } catch (Exception e) {
        e.printStackTrace();
        MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL);
    }
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM