feat: 历史记录搜索 issues #27

This commit is contained in:
guozhigq
2023-10-01 21:12:18 +08:00
parent 1061ffca3d
commit d83b4bc59e
9 changed files with 314 additions and 13 deletions

View File

@ -170,6 +170,9 @@ class Api {
// 删除某条历史记录
static const String delHistory = '/x/v2/history/delete';
// 搜索历史记录
static const String searchHistory = '/x/web-goblin/history/search';
// 热搜
static const String hotSearchList =
'https://s.search.bilibili.com/main/hotword';

View File

@ -274,4 +274,22 @@ class UserHttp {
return {'status': false, 'msg': res.data['message']};
}
}
// 搜索历史记录
static Future searchHistory(
{required int pn, required String keyword}) async {
var res = await Request().get(
Api.searchHistory,
data: {
'pn': pn,
'keyword': keyword,
'business': 'all',
},
);
if (res.data['code'] == 0) {
return {'status': true, 'data': HistoryData.fromJson(res.data['data'])};
} else {
return {'status': false, 'msg': res.data['message']};
}
}
}