mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
28 lines
726 B
Dart
28 lines
726 B
Dart
import 'package:PiliPlus/grpc/bilibili/community/service/dm/v1.pb.dart';
|
|
import 'package:PiliPlus/grpc/grpc_repo.dart';
|
|
import 'package:PiliPlus/http/loading_state.dart';
|
|
import 'package:fixnum/fixnum.dart';
|
|
|
|
class DmGrpc {
|
|
static Future<LoadingState<DmSegMobileReply>> dmSegMobile({
|
|
required int cid,
|
|
required int segmentIndex,
|
|
int type = 1,
|
|
}) async {
|
|
final res = await GrpcRepo.request(
|
|
GrpcUrl.dmSegMobile,
|
|
DmSegMobileReq(
|
|
oid: Int64(cid),
|
|
segmentIndex: Int64(segmentIndex),
|
|
type: type,
|
|
),
|
|
DmSegMobileReply.fromBuffer,
|
|
);
|
|
if (res['status']) {
|
|
return LoadingState.success(res['data']);
|
|
} else {
|
|
return const Error('');
|
|
}
|
|
}
|
|
}
|