All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hiczp.bilibili.api.web.live.LiveService Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
package com.hiczp.bilibili.api.web.live;

import com.hiczp.bilibili.api.web.live.entity.SendHeartBeatResponseEntity;
import com.hiczp.bilibili.api.web.live.entity.UserInfoEntity;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

public interface LiveService {
    /**
     * 直播间心跳包
     *
     * @param timestamp 时间戳(不是 unix 时间戳)
     * @return 未登录时返回 401
     */
    @GET("feed/v1/feed/heartBeat")
    Call sendHeartBeat(@Query("_") long timestamp);

    default Call sendHeartBeat() {
        return sendHeartBeat(System.currentTimeMillis());
    }

    /**
     * 获取用户信息
     *
     * @param timestamp 时间戳(不是 unix 时间戳)
     * @return 成功时, code 为 "REPONSE_OK", 未登录时返回 500
     */
    @GET("User/getUserInfo")
    Call getUserInfo(@Query("ts") long timestamp);

    default Call getUserInfo() {
        return getUserInfo(System.currentTimeMillis());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy