merge mine & media

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-28 14:27:18 +08:00
parent 6ca7efe8d1
commit 65b432ed2c
40 changed files with 903 additions and 1038 deletions

View File

@@ -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']);
}

View File

@@ -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 {

View File

@@ -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']);
}
}