recommendation users

This commit is contained in:
wgh19
2024-05-13 20:24:07 +08:00
parent f3125ddc9a
commit b4cff946aa
3 changed files with 100 additions and 5 deletions

View File

@@ -347,4 +347,15 @@ class Network {
return Res.error(res.errorMessage);
}
}
Future<Res<List<UserPreview>>> getRecommendationUsers() async {
var res = await apiGet("/v1/user/recommended?filter=for_android");
if (res.success) {
return Res(
(res.data["user_previews"] as List).map((e) => UserPreview.fromJson(e["user"])).toList(),
subData: res.data["next_url"]);
} else {
return Res.error(res.errorMessage);
}
}
}