update
This commit is contained in:
@@ -8,6 +8,9 @@ import com.yutou.common.okhttp.HttpBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 直播间相关API
|
||||
* <a href="https://socialsisteryi.github.io/bilibili-API-collect/docs/live/info.html#%E8%8E%B7%E5%8F%96%E7%9B%B4%E6%92%AD%E9%97%B4%E4%BF%A1%E6%81%AF">文档地址</a>
|
||||
@@ -55,8 +58,13 @@ public interface LiveApi {
|
||||
@GET("/xlive/web-room/v1/giftPanel/giftConfig?platform=pc")
|
||||
Call<HttpBody<BaseBean>> getLiveGiftConfig();
|
||||
|
||||
/**
|
||||
* 批量查询直播间状态
|
||||
* @param uids 要查询的主播 mid
|
||||
* @return <a href="https://socialsisteryi.github.io/bilibili-API-collect/docs/live/info.html#%E6%89%B9%E9%87%8F%E6%9F%A5%E8%AF%A2%E7%9B%B4%E6%92%AD%E9%97%B4%E7%8A%B6%E6%80%81">文档</a>
|
||||
*/
|
||||
@POST("/room/v1/Room/get_status_info_by_uids")
|
||||
Call<HttpBody<BaseBean>> getLiveRoomStatus( @Body
|
||||
Call<HttpBody<Map<String,LiveAnchorInfo>>> getLiveRoomStatus(@Body
|
||||
JSONObject uids);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yutou.biliapi.databases;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.fastjson2.util.DateUtils;
|
||||
import com.yutou.biliapi.bean.live.*;
|
||||
import com.yutou.biliapi.bean.live.database.*;
|
||||
@@ -66,7 +67,8 @@ public class BiliLiveDatabase extends SQLiteManager {
|
||||
new LiveInteractWordDatabaseBean(),
|
||||
new LiveSuperChatDatabaseBean(),
|
||||
new LiveSourceDatabaseBean(),
|
||||
new LiveVideoDatabaseBean()
|
||||
new LiveVideoDatabaseBean(),
|
||||
new LiveGuardBuyBean()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -136,19 +138,31 @@ public class BiliLiveDatabase extends SQLiteManager {
|
||||
}
|
||||
return super.get(tableName, where, clazz);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
BiliLiveDatabase biliLiveDatabase = new BiliLiveDatabase(LiveRoomConfig.buildConfig("5265"));
|
||||
public void resetSQL(){
|
||||
List<AbsDatabasesBean> list = List.of(
|
||||
new LiveInfoDatabaseBean(),
|
||||
new LiveDanmuDatabaseBean(),
|
||||
new LiveGiftDatabaseBean(),
|
||||
new LiveGuardBuyBean(),
|
||||
new LiveInteractWordDatabaseBean(),
|
||||
new LiveSuperChatDatabaseBean()
|
||||
);
|
||||
for (AbsDatabasesBean item : list) {
|
||||
biliLiveDatabase.clearTable(item.getTableName());
|
||||
clearTable(item.getTableName());
|
||||
}
|
||||
recreateSql(list);
|
||||
}
|
||||
public void resetData(){
|
||||
List<LiveSourceDatabaseBean> list = get(new LiveSourceDatabaseBean().getTableName(), LiveSourceDatabaseBean.class);
|
||||
for (LiveSourceDatabaseBean item : list) {
|
||||
WSData data = WSData.parse(JSONObject.parseObject(item.getJson()));
|
||||
addData(data);
|
||||
}
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
BiliLiveDatabase biliLiveDatabase = new BiliLiveDatabase(LiveRoomConfig.buildConfig("5265"));
|
||||
// biliLiveDatabase.resetSQL();
|
||||
biliLiveDatabase.resetData();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user