mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-17 15:46:14 +08:00
@@ -1,5 +1,11 @@
|
||||
import 'package:PiliPlus/grpc/bilibili/app/dynamic/v1.pb.dart';
|
||||
import 'package:PiliPlus/grpc/grpc_repo.dart';
|
||||
import 'package:PiliPlus/grpc/bilibili/app/dynamic/v1.pb.dart'
|
||||
show DynRedReq, TabOffset, DynRedReply;
|
||||
import 'package:PiliPlus/grpc/bilibili/app/dynamic/v2.pb.dart'
|
||||
show OpusType, OpusDetailReq, OpusDetailResp;
|
||||
import 'package:PiliPlus/grpc/grpc_req.dart';
|
||||
import 'package:PiliPlus/grpc/url.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:fixnum/fixnum.dart';
|
||||
|
||||
class DynGrpc {
|
||||
// static Future dynSpace({
|
||||
@@ -19,11 +25,25 @@ class DynGrpc {
|
||||
// }
|
||||
|
||||
static Future<int?> dynRed() async {
|
||||
final res = await GrpcRepo.request(
|
||||
final res = await GrpcReq.request(
|
||||
GrpcUrl.dynRed,
|
||||
DynRedReq(tabOffset: [TabOffset(tab: 1)]),
|
||||
DynRedReply.fromBuffer,
|
||||
);
|
||||
return res.dataOrNull?.dynRedItem.count.toInt();
|
||||
}
|
||||
|
||||
static Future<LoadingState<OpusDetailResp>> opusDetail({
|
||||
OpusType? opusType,
|
||||
required int oid,
|
||||
}) async {
|
||||
return GrpcReq.request(
|
||||
GrpcUrl.opusDetail,
|
||||
OpusDetailReq(
|
||||
opusType: opusType,
|
||||
oid: Int64(oid),
|
||||
),
|
||||
OpusDetailResp.fromBuffer,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user