mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
32 lines
874 B
Dart
32 lines
874 B
Dart
import 'package:PiliPlus/grpc/bilibili/app/dynamic/v2.pb.dart';
|
|
import 'package:PiliPlus/grpc/bilibili/pagination.pb.dart';
|
|
import 'package:PiliPlus/grpc/grpc_repo.dart';
|
|
import 'package:PiliPlus/http/loading_state.dart';
|
|
import 'package:fixnum/fixnum.dart';
|
|
|
|
class SpaceGrpc {
|
|
static Future<LoadingState<OpusSpaceFlowResp>> opusSpaceFlow({
|
|
required int hostMid,
|
|
String? next,
|
|
required String filterType,
|
|
}) async {
|
|
final res = await GrpcRepo.request(
|
|
GrpcUrl.opusSpaceFlow,
|
|
OpusSpaceFlowReq(
|
|
hostMid: Int64(hostMid),
|
|
pagination: Pagination(
|
|
pageSize: 20,
|
|
next: next,
|
|
),
|
|
filterType: filterType,
|
|
),
|
|
OpusSpaceFlowResp.fromBuffer,
|
|
);
|
|
if (res['status']) {
|
|
return LoadingState.success(res['data']);
|
|
} else {
|
|
return LoadingState.error(res['msg']);
|
|
}
|
|
}
|
|
}
|