feat: 热搜关键词

This commit is contained in:
guozhigq
2023-06-20 10:27:54 +08:00
parent 04704ae8f3
commit 335718b3a0
13 changed files with 483 additions and 8 deletions

View File

@ -140,4 +140,8 @@ class Api {
// 获取历史记录
static const String historyList = '/x/web-interface/history/cursor';
// 热搜
static const String hotSearchList =
'https://s.search.bilibili.com/main/hotword';
}

2
lib/http/index.dart Normal file
View File

@ -0,0 +1,2 @@
export 'api.dart';
export 'init.dart';

20
lib/http/search.dart Normal file
View File

@ -0,0 +1,20 @@
import 'package:pilipala/http/index.dart';
import 'package:pilipala/models/search/hot.dart';
class SearchHttp {
static Future hotSearchList() async {
var res = await Request().get(Api.hotSearchList);
if (res.data['code'] == 0) {
return {
'status': true,
'data': HotSearchModel.fromJson(res.data),
};
} else {
return {
'status': false,
'date': [],
'msg': '请求错误 🙅',
};
}
}
}