mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 11:06:51 +08:00
merge mine & media
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -5,31 +5,6 @@ import 'package:PiliPlus/models_new/follow/data.dart';
|
||||
|
||||
class FollowHttp {
|
||||
static Future<LoadingState<FollowData>> followings({
|
||||
int? vmid,
|
||||
int? pn,
|
||||
int ps = 50,
|
||||
String orderType = '',
|
||||
}) async {
|
||||
var res = await Request().get(
|
||||
Api.followings,
|
||||
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']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<FollowData>> followingsNew({
|
||||
int? vmid,
|
||||
int? pn,
|
||||
int ps = 20,
|
||||
@@ -45,11 +20,8 @@ class FollowHttp {
|
||||
'order_type': orderType,
|
||||
},
|
||||
);
|
||||
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(
|
||||
FollowData.fromJson(res.data['data']),
|
||||
);
|
||||
return Success(FollowData.fromJson(res.data['data']));
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ class SearchHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<PgcInfoModel>> pgcInfoNew({
|
||||
static Future<LoadingState<PgcInfoModel>> pgcInfo({
|
||||
int? seasonId,
|
||||
int? epId,
|
||||
}) async {
|
||||
@@ -207,27 +207,6 @@ class SearchHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> pgcInfo({
|
||||
dynamic seasonId,
|
||||
dynamic epId,
|
||||
}) async {
|
||||
var res = await Request().get(
|
||||
Api.pgcInfo,
|
||||
queryParameters: {
|
||||
'season_id': ?seasonId,
|
||||
'ep_id': ?epId,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': PgcInfoModel.fromJson(res.data['result']),
|
||||
};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<SearchTrendingData>> searchTrending({
|
||||
int limit = 30,
|
||||
}) async {
|
||||
|
||||
@@ -28,14 +28,14 @@ class UserHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<dynamic> userInfo() async {
|
||||
static Future<LoadingState<UserInfoData>> userInfo() async {
|
||||
var res = await Request().get(Api.userInfo);
|
||||
if (res.data['code'] == 0) {
|
||||
UserInfoData data = UserInfoData.fromJson(res.data['data']);
|
||||
GlobalData().coins = data.money;
|
||||
return {'status': true, 'data': data};
|
||||
return Success(data);
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user