feat: 粉丝页面

This commit is contained in:
guozhigq
2023-07-11 15:37:47 +08:00
parent 522ce60750
commit a2f65cfe09
10 changed files with 234 additions and 4 deletions

View File

@ -180,4 +180,9 @@ class Api {
// 关注分类
// https://api.bilibili.com/x/relation/tags
static const String followingsClass = '/x/relation/tags';
// 粉丝
// vmid 用户id pn 页码 ps 每页个数最大50 order: desc
// order_type 排序规则 最近访问传空,最常访问传 attention
static const String fans = 'https://api.bilibili.com/x/relation/fans';
}

23
lib/http/fan.dart Normal file
View File

@ -0,0 +1,23 @@
import 'package:pilipala/http/index.dart';
import 'package:pilipala/models/fans/result.dart';
class FanHttp {
static Future fans({int? vmid, int? pn, int? ps, String? orderType}) async {
var res = await Request().get(Api.fans, data: {
'vmid': vmid,
'pn': pn,
'ps': ps,
'order': 'desc',
'order_type': orderType,
});
if (res.data['code'] == 0) {
return {'status': true, 'data': FansDataModel.fromJson(res.data['data'])};
} else {
return {
'status': false,
'data': [],
'msg': res.data['message'],
};
}
}
}