mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
refactor: fan
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import 'package:PiliPalaX/http/loading_state.dart';
|
||||
|
||||
import '../models/fans/result.dart';
|
||||
import 'index.dart';
|
||||
|
||||
class FanHttp {
|
||||
static Future fans({int? vmid, int? pn, int? ps, String? orderType}) async {
|
||||
static Future<LoadingState> fans(
|
||||
{int? vmid, int? pn, int? ps, String? orderType}) async {
|
||||
var res = await Request().get(Api.fans, data: {
|
||||
'vmid': vmid,
|
||||
'pn': pn,
|
||||
@@ -11,13 +14,9 @@ class FanHttp {
|
||||
'order_type': orderType,
|
||||
});
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': FansDataModel.fromJson(res.data['data'])};
|
||||
return LoadingState.success(FansDataModel.fromJson(res.data['data']));
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
return LoadingState.error(res.data['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user