feat: 热搜关键词
This commit is contained in:
@ -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
2
lib/http/index.dart
Normal file
@ -0,0 +1,2 @@
|
||||
export 'api.dart';
|
||||
export 'init.dart';
|
||||
20
lib/http/search.dart
Normal file
20
lib/http/search.dart
Normal 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': '请求错误 🙅',
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user