refa: follow page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-21 20:17:45 +08:00
parent e6e9ce7d57
commit 8b28a31d09
9 changed files with 271 additions and 424 deletions

View File

@@ -470,8 +470,8 @@ class MemberHttp {
if (res.data['code'] == 0) {
return {
'status': true,
'data': res.data['data']
.map<MemberTagItemModel>((e) => MemberTagItemModel.fromJson(e))
'data': (res.data['data'] as List?)
?.map<MemberTagItemModel>((e) => MemberTagItemModel.fromJson(e))
.toList()
};
} else {
@@ -525,28 +525,27 @@ class MemberHttp {
}
// 获取某分组下的up
static Future followUpGroup(
static Future<LoadingState<List<FollowItemModel>?>> followUpGroup(
int? mid,
int? tagid,
int? pn,
int? ps,
) async {
var res = await Request().get(Api.followUpGroup, queryParameters: {
'mid': mid,
'tagid': tagid,
'pn': pn,
'ps': ps,
});
var res = await Request().get(
Api.followUpGroup,
queryParameters: {
'mid': mid,
'tagid': tagid,
'pn': pn,
'ps': ps,
},
);
if (res.data['code'] == 0) {
// FollowItemModel
return {
'status': true,
'data': res.data['data']
.map<FollowItemModel>((e) => FollowItemModel.fromJson(e))
.toList()
};
return LoadingState.success((res.data['data'] as List?)
?.map<FollowItemModel>((e) => FollowItemModel.fromJson(e))
.toList());
} else {
return {'status': false, 'msg': res.data['message']};
return LoadingState.error(res.data['message']);
}
}