mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
30 lines
704 B
Dart
30 lines
704 B
Dart
import 'package:PiliPlus/http/api.dart';
|
|
import 'package:PiliPlus/http/init.dart';
|
|
import 'package:PiliPlus/http/loading_state.dart';
|
|
import 'package:PiliPlus/models_new/follow/data.dart';
|
|
|
|
class FanHttp {
|
|
static Future<LoadingState<FollowData>> fans({
|
|
int? vmid,
|
|
int? pn,
|
|
int ps = 20,
|
|
String? orderType,
|
|
}) async {
|
|
var res = await Request().get(
|
|
Api.fans,
|
|
queryParameters: {
|
|
'vmid': vmid,
|
|
'pn': pn,
|
|
'ps': ps,
|
|
'order': 'desc',
|
|
'order_type': orderType,
|
|
},
|
|
);
|
|
if (res.data['code'] == 0) {
|
|
return Success(FollowData.fromJson(res.data['data']));
|
|
} else {
|
|
return Error(res.data['message']);
|
|
}
|
|
}
|
|
}
|