mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
refactor: migrate to gRPC [wip]
This commit is contained in:
124
lib/grpc/app/playeronline/v1/playeronline.dart
Normal file
124
lib/grpc/app/playeronline/v1/playeronline.dart
Normal file
@@ -0,0 +1,124 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:PiliPalaX/grpc/device/device.pb.dart';
|
||||
import 'package:PiliPalaX/grpc/fawkes/fawkes.pb.dart';
|
||||
import 'package:PiliPalaX/grpc/locale/locale.pb.dart';
|
||||
import 'package:PiliPalaX/grpc/metadata/metadata.pb.dart';
|
||||
import 'package:PiliPalaX/grpc/network/network.pb.dart';
|
||||
import 'package:PiliPalaX/grpc/app/playeronline/v1/playeronline.pbgrpc.dart';
|
||||
import 'package:PiliPalaX/grpc/restriction/restriction.pb.dart';
|
||||
import 'package:PiliPalaX/utils/storage.dart';
|
||||
import 'package:PiliPalaX/utils/utils.dart';
|
||||
import 'package:fixnum/src/int64.dart';
|
||||
import 'package:grpc/grpc.dart';
|
||||
|
||||
class OnlineClient {
|
||||
ClientChannel? _channel;
|
||||
PlayerOnlineClient? _stub;
|
||||
|
||||
OnlineClient() {
|
||||
_channel = ClientChannel(
|
||||
'grpc.biliapi.net',
|
||||
port: 443,
|
||||
options: ChannelOptions(
|
||||
credentials: ChannelCredentials.secure(),
|
||||
),
|
||||
);
|
||||
_stub = PlayerOnlineClient(_channel!);
|
||||
}
|
||||
|
||||
Future<void> playerOnline({
|
||||
int aid = 0,
|
||||
int cid = 0,
|
||||
}) async {
|
||||
try {
|
||||
int mid = GStorage.userInfo.get('userInfoCache').mid;
|
||||
String accessKey = GStorage.localCache
|
||||
.get(LocalCacheKey.accessKey, defaultValue: {})['value'];
|
||||
String traceId = Utils.genTraceId();
|
||||
String eId = Utils.genAuroraEid(mid);
|
||||
|
||||
final metadata = {
|
||||
'user-agent':
|
||||
'Dalvik/2.1.0 (Linux; U; Android 12; android Build/android) 7380300 os/android model/android mobi_app/android build/7380300 channel/master innerVer/7380300 osVer/12 network/2 grpc-java-cronet/1.36.1',
|
||||
'x-bili-gaia-vtoken': '',
|
||||
'x-bili-aurora-eid': eId,
|
||||
'x-bili-mid': mid.toString(),
|
||||
'x-bili-aurora-zone': '',
|
||||
'x-bili-trace-id': traceId,
|
||||
'authorization': 'identify_v1 $accessKey',
|
||||
'buvid': 'XX82B818F96FB2F312B3A1BA44DB41892FF99',
|
||||
'bili-http-engine': 'cronet',
|
||||
'te': 'trailers',
|
||||
'x-bili-fawkes-req-bin': base64Encode((FawkesReq()
|
||||
..appkey = 'android64'
|
||||
..env = 'prod'
|
||||
..sessionId = '5974f68d')
|
||||
.writeToBuffer()),
|
||||
'x-bili-metadata-bin': base64Encode((Metadata()
|
||||
..accessKey = accessKey
|
||||
..mobiApp = 'android'
|
||||
..device = 'phone'
|
||||
..build = 7380300
|
||||
..channel = 'bili'
|
||||
..buvid = 'XX82B818F96FB2F312B3A1BA44DB41892FF99'
|
||||
..platform = 'android')
|
||||
.writeToBuffer()),
|
||||
'x-bili-device-bin': base64Encode((Device()
|
||||
..appId = 1
|
||||
..build = 7380300
|
||||
..buvid = 'XX82B818F96FB2F312B3A1BA44DB41892FF99'
|
||||
..mobiApp = 'android'
|
||||
..platform = 'android'
|
||||
..device = 'phone'
|
||||
..channel = 'bili'
|
||||
..brand = ''
|
||||
..model = ''
|
||||
..osver = ''
|
||||
..fpLocal = ''
|
||||
..fpRemote = ''
|
||||
..versionName = ''
|
||||
..fp = ''
|
||||
..fts = Int64(123456789))
|
||||
.writeToBuffer()),
|
||||
'x-bili-network-bin': base64Encode((Network()
|
||||
..type = NetworkType.WIFI
|
||||
..tf = TFType.TF_UNKNOWN
|
||||
..oid = 'CMCC')
|
||||
.writeToBuffer()),
|
||||
'x-bili-restriction-bin': base64Encode((Restriction()
|
||||
..teenagersMode = false
|
||||
..lessonsMode = false
|
||||
..mode = ModeType.NORMAL
|
||||
..review = false
|
||||
..disableRcmd = false
|
||||
..basicMode = false)
|
||||
.writeToBuffer()),
|
||||
'x-bili-locale-bin': base64Encode((Locale()
|
||||
..cLocale = LocaleIds(language: 'CN')
|
||||
..sLocale = LocaleIds(language: 'CN')
|
||||
..simCode = ''
|
||||
..timezone = 'Asia/Shanghai')
|
||||
.writeToBuffer()),
|
||||
'x-bili-exps-bin': '',
|
||||
};
|
||||
|
||||
final options = CallOptions(
|
||||
metadata: metadata,
|
||||
);
|
||||
|
||||
final request = PlayerOnlineReq()
|
||||
..aid = Int64(aid)
|
||||
..cid = Int64(cid)
|
||||
..playOpen = true;
|
||||
final response = await _stub!.playerOnline(request, options: options);
|
||||
print('Server response: ${response.totalText}');
|
||||
} catch (e) {
|
||||
print('Caught error: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> shutdown() async {
|
||||
await _channel?.shutdown();
|
||||
}
|
||||
}
|
||||
477
lib/grpc/app/playeronline/v1/playeronline.pb.dart
Normal file
477
lib/grpc/app/playeronline/v1/playeronline.pb.dart
Normal file
@@ -0,0 +1,477 @@
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: playeronline.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// 空回复
|
||||
class NoReply extends $pb.GeneratedMessage {
|
||||
factory NoReply() => create();
|
||||
NoReply._() : super();
|
||||
factory NoReply.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory NoReply.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'NoReply', package: const $pb.PackageName(_omitMessageNames ? '' : 'bilibili.app.playeronline.v1'), createEmptyInstance: create)
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
NoReply clone() => NoReply()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
NoReply copyWith(void Function(NoReply) updates) => super.copyWith((message) => updates(message as NoReply)) as NoReply;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static NoReply create() => NoReply._();
|
||||
NoReply createEmptyInstance() => create();
|
||||
static $pb.PbList<NoReply> createRepeated() => $pb.PbList<NoReply>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static NoReply getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<NoReply>(create);
|
||||
static NoReply? _defaultInstance;
|
||||
}
|
||||
|
||||
/// 获取在线人数-回复
|
||||
class PlayerOnlineReply extends $pb.GeneratedMessage {
|
||||
factory PlayerOnlineReply({
|
||||
$core.String? totalText,
|
||||
$fixnum.Int64? secNext,
|
||||
$core.bool? bottomShow,
|
||||
$core.bool? sdmShow,
|
||||
$core.String? sdmText,
|
||||
$fixnum.Int64? totalNumber,
|
||||
$core.String? totalNumberText,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (totalText != null) {
|
||||
$result.totalText = totalText;
|
||||
}
|
||||
if (secNext != null) {
|
||||
$result.secNext = secNext;
|
||||
}
|
||||
if (bottomShow != null) {
|
||||
$result.bottomShow = bottomShow;
|
||||
}
|
||||
if (sdmShow != null) {
|
||||
$result.sdmShow = sdmShow;
|
||||
}
|
||||
if (sdmText != null) {
|
||||
$result.sdmText = sdmText;
|
||||
}
|
||||
if (totalNumber != null) {
|
||||
$result.totalNumber = totalNumber;
|
||||
}
|
||||
if (totalNumberText != null) {
|
||||
$result.totalNumberText = totalNumberText;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
PlayerOnlineReply._() : super();
|
||||
factory PlayerOnlineReply.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory PlayerOnlineReply.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PlayerOnlineReply', package: const $pb.PackageName(_omitMessageNames ? '' : 'bilibili.app.playeronline.v1'), createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'totalText')
|
||||
..aInt64(2, _omitFieldNames ? '' : 'secNext')
|
||||
..aOB(3, _omitFieldNames ? '' : 'bottomShow')
|
||||
..aOB(4, _omitFieldNames ? '' : 'sdmShow')
|
||||
..aOS(5, _omitFieldNames ? '' : 'sdmText')
|
||||
..aInt64(6, _omitFieldNames ? '' : 'totalNumber')
|
||||
..aOS(7, _omitFieldNames ? '' : 'totalNumberText')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
PlayerOnlineReply clone() => PlayerOnlineReply()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
PlayerOnlineReply copyWith(void Function(PlayerOnlineReply) updates) => super.copyWith((message) => updates(message as PlayerOnlineReply)) as PlayerOnlineReply;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PlayerOnlineReply create() => PlayerOnlineReply._();
|
||||
PlayerOnlineReply createEmptyInstance() => create();
|
||||
static $pb.PbList<PlayerOnlineReply> createRepeated() => $pb.PbList<PlayerOnlineReply>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PlayerOnlineReply getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<PlayerOnlineReply>(create);
|
||||
static PlayerOnlineReply? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get totalText => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set totalText($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasTotalText() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearTotalText() => clearField(1);
|
||||
|
||||
/// 下次轮询间隔时间
|
||||
@$pb.TagNumber(2)
|
||||
$fixnum.Int64 get secNext => $_getI64(1);
|
||||
@$pb.TagNumber(2)
|
||||
set secNext($fixnum.Int64 v) { $_setInt64(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasSecNext() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearSecNext() => clearField(2);
|
||||
|
||||
/// 是否底部显示
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool get bottomShow => $_getBF(2);
|
||||
@$pb.TagNumber(3)
|
||||
set bottomShow($core.bool v) { $_setBool(2, v); }
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasBottomShow() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearBottomShow() => clearField(3);
|
||||
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool get sdmShow => $_getBF(3);
|
||||
@$pb.TagNumber(4)
|
||||
set sdmShow($core.bool v) { $_setBool(3, v); }
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool hasSdmShow() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
void clearSdmShow() => clearField(4);
|
||||
|
||||
@$pb.TagNumber(5)
|
||||
$core.String get sdmText => $_getSZ(4);
|
||||
@$pb.TagNumber(5)
|
||||
set sdmText($core.String v) { $_setString(4, v); }
|
||||
@$pb.TagNumber(5)
|
||||
$core.bool hasSdmText() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
void clearSdmText() => clearField(5);
|
||||
|
||||
@$pb.TagNumber(6)
|
||||
$fixnum.Int64 get totalNumber => $_getI64(5);
|
||||
@$pb.TagNumber(6)
|
||||
set totalNumber($fixnum.Int64 v) { $_setInt64(5, v); }
|
||||
@$pb.TagNumber(6)
|
||||
$core.bool hasTotalNumber() => $_has(5);
|
||||
@$pb.TagNumber(6)
|
||||
void clearTotalNumber() => clearField(6);
|
||||
|
||||
@$pb.TagNumber(7)
|
||||
$core.String get totalNumberText => $_getSZ(6);
|
||||
@$pb.TagNumber(7)
|
||||
set totalNumberText($core.String v) { $_setString(6, v); }
|
||||
@$pb.TagNumber(7)
|
||||
$core.bool hasTotalNumberText() => $_has(6);
|
||||
@$pb.TagNumber(7)
|
||||
void clearTotalNumberText() => clearField(7);
|
||||
}
|
||||
|
||||
/// 获取在线人数-请求
|
||||
class PlayerOnlineReq extends $pb.GeneratedMessage {
|
||||
factory PlayerOnlineReq({
|
||||
$fixnum.Int64? aid,
|
||||
$fixnum.Int64? cid,
|
||||
$core.bool? playOpen,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (aid != null) {
|
||||
$result.aid = aid;
|
||||
}
|
||||
if (cid != null) {
|
||||
$result.cid = cid;
|
||||
}
|
||||
if (playOpen != null) {
|
||||
$result.playOpen = playOpen;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
PlayerOnlineReq._() : super();
|
||||
factory PlayerOnlineReq.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory PlayerOnlineReq.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PlayerOnlineReq', package: const $pb.PackageName(_omitMessageNames ? '' : 'bilibili.app.playeronline.v1'), createEmptyInstance: create)
|
||||
..aInt64(1, _omitFieldNames ? '' : 'aid')
|
||||
..aInt64(2, _omitFieldNames ? '' : 'cid')
|
||||
..aOB(3, _omitFieldNames ? '' : 'playOpen')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
PlayerOnlineReq clone() => PlayerOnlineReq()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
PlayerOnlineReq copyWith(void Function(PlayerOnlineReq) updates) => super.copyWith((message) => updates(message as PlayerOnlineReq)) as PlayerOnlineReq;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PlayerOnlineReq create() => PlayerOnlineReq._();
|
||||
PlayerOnlineReq createEmptyInstance() => create();
|
||||
static $pb.PbList<PlayerOnlineReq> createRepeated() => $pb.PbList<PlayerOnlineReq>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PlayerOnlineReq getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<PlayerOnlineReq>(create);
|
||||
static PlayerOnlineReq? _defaultInstance;
|
||||
|
||||
/// 稿件 avid
|
||||
@$pb.TagNumber(1)
|
||||
$fixnum.Int64 get aid => $_getI64(0);
|
||||
@$pb.TagNumber(1)
|
||||
set aid($fixnum.Int64 v) { $_setInt64(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasAid() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearAid() => clearField(1);
|
||||
|
||||
/// 视频 cid
|
||||
@$pb.TagNumber(2)
|
||||
$fixnum.Int64 get cid => $_getI64(1);
|
||||
@$pb.TagNumber(2)
|
||||
set cid($fixnum.Int64 v) { $_setInt64(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasCid() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearCid() => clearField(2);
|
||||
|
||||
/// 是否在播放中
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool get playOpen => $_getBF(2);
|
||||
@$pb.TagNumber(3)
|
||||
set playOpen($core.bool v) { $_setBool(2, v); }
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasPlayOpen() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearPlayOpen() => clearField(3);
|
||||
}
|
||||
|
||||
class PremiereInfoReply extends $pb.GeneratedMessage {
|
||||
factory PremiereInfoReply({
|
||||
$core.String? premiereOverText,
|
||||
$fixnum.Int64? participant,
|
||||
$fixnum.Int64? interaction,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (premiereOverText != null) {
|
||||
$result.premiereOverText = premiereOverText;
|
||||
}
|
||||
if (participant != null) {
|
||||
$result.participant = participant;
|
||||
}
|
||||
if (interaction != null) {
|
||||
$result.interaction = interaction;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
PremiereInfoReply._() : super();
|
||||
factory PremiereInfoReply.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory PremiereInfoReply.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PremiereInfoReply', package: const $pb.PackageName(_omitMessageNames ? '' : 'bilibili.app.playeronline.v1'), createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'premiereOverText')
|
||||
..aInt64(2, _omitFieldNames ? '' : 'participant')
|
||||
..aInt64(3, _omitFieldNames ? '' : 'interaction')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
PremiereInfoReply clone() => PremiereInfoReply()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
PremiereInfoReply copyWith(void Function(PremiereInfoReply) updates) => super.copyWith((message) => updates(message as PremiereInfoReply)) as PremiereInfoReply;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PremiereInfoReply create() => PremiereInfoReply._();
|
||||
PremiereInfoReply createEmptyInstance() => create();
|
||||
static $pb.PbList<PremiereInfoReply> createRepeated() => $pb.PbList<PremiereInfoReply>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PremiereInfoReply getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<PremiereInfoReply>(create);
|
||||
static PremiereInfoReply? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get premiereOverText => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set premiereOverText($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasPremiereOverText() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearPremiereOverText() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$fixnum.Int64 get participant => $_getI64(1);
|
||||
@$pb.TagNumber(2)
|
||||
set participant($fixnum.Int64 v) { $_setInt64(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasParticipant() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearParticipant() => clearField(2);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$fixnum.Int64 get interaction => $_getI64(2);
|
||||
@$pb.TagNumber(3)
|
||||
set interaction($fixnum.Int64 v) { $_setInt64(2, v); }
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasInteraction() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearInteraction() => clearField(3);
|
||||
}
|
||||
|
||||
class PremiereInfoReq extends $pb.GeneratedMessage {
|
||||
factory PremiereInfoReq({
|
||||
$fixnum.Int64? aid,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (aid != null) {
|
||||
$result.aid = aid;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
PremiereInfoReq._() : super();
|
||||
factory PremiereInfoReq.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory PremiereInfoReq.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PremiereInfoReq', package: const $pb.PackageName(_omitMessageNames ? '' : 'bilibili.app.playeronline.v1'), createEmptyInstance: create)
|
||||
..aInt64(1, _omitFieldNames ? '' : 'aid')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
PremiereInfoReq clone() => PremiereInfoReq()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
PremiereInfoReq copyWith(void Function(PremiereInfoReq) updates) => super.copyWith((message) => updates(message as PremiereInfoReq)) as PremiereInfoReq;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PremiereInfoReq create() => PremiereInfoReq._();
|
||||
PremiereInfoReq createEmptyInstance() => create();
|
||||
static $pb.PbList<PremiereInfoReq> createRepeated() => $pb.PbList<PremiereInfoReq>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PremiereInfoReq getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<PremiereInfoReq>(create);
|
||||
static PremiereInfoReq? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$fixnum.Int64 get aid => $_getI64(0);
|
||||
@$pb.TagNumber(1)
|
||||
set aid($fixnum.Int64 v) { $_setInt64(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasAid() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearAid() => clearField(1);
|
||||
}
|
||||
|
||||
class ReportWatchReq extends $pb.GeneratedMessage {
|
||||
factory ReportWatchReq({
|
||||
$fixnum.Int64? aid,
|
||||
$core.String? biz,
|
||||
$core.String? buvid,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (aid != null) {
|
||||
$result.aid = aid;
|
||||
}
|
||||
if (biz != null) {
|
||||
$result.biz = biz;
|
||||
}
|
||||
if (buvid != null) {
|
||||
$result.buvid = buvid;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
ReportWatchReq._() : super();
|
||||
factory ReportWatchReq.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory ReportWatchReq.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ReportWatchReq', package: const $pb.PackageName(_omitMessageNames ? '' : 'bilibili.app.playeronline.v1'), createEmptyInstance: create)
|
||||
..aInt64(1, _omitFieldNames ? '' : 'aid')
|
||||
..aOS(2, _omitFieldNames ? '' : 'biz')
|
||||
..aOS(3, _omitFieldNames ? '' : 'buvid')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
ReportWatchReq clone() => ReportWatchReq()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
ReportWatchReq copyWith(void Function(ReportWatchReq) updates) => super.copyWith((message) => updates(message as ReportWatchReq)) as ReportWatchReq;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ReportWatchReq create() => ReportWatchReq._();
|
||||
ReportWatchReq createEmptyInstance() => create();
|
||||
static $pb.PbList<ReportWatchReq> createRepeated() => $pb.PbList<ReportWatchReq>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ReportWatchReq getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ReportWatchReq>(create);
|
||||
static ReportWatchReq? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$fixnum.Int64 get aid => $_getI64(0);
|
||||
@$pb.TagNumber(1)
|
||||
set aid($fixnum.Int64 v) { $_setInt64(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasAid() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearAid() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get biz => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set biz($core.String v) { $_setString(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasBiz() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearBiz() => clearField(2);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get buvid => $_getSZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set buvid($core.String v) { $_setString(2, v); }
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasBuvid() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearBuvid() => clearField(3);
|
||||
}
|
||||
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
11
lib/grpc/app/playeronline/v1/playeronline.pbenum.dart
Normal file
11
lib/grpc/app/playeronline/v1/playeronline.pbenum.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: playeronline.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
99
lib/grpc/app/playeronline/v1/playeronline.pbgrpc.dart
Normal file
99
lib/grpc/app/playeronline/v1/playeronline.pbgrpc.dart
Normal file
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: playeronline.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:async' as $async;
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:grpc/service_api.dart' as $grpc;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import 'playeronline.pb.dart' as $0;
|
||||
|
||||
export 'playeronline.pb.dart';
|
||||
|
||||
@$pb.GrpcServiceName('bilibili.app.playeronline.v1.PlayerOnline')
|
||||
class PlayerOnlineClient extends $grpc.Client {
|
||||
static final _$playerOnline = $grpc.ClientMethod<$0.PlayerOnlineReq, $0.PlayerOnlineReply>(
|
||||
'/bilibili.app.playeronline.v1.PlayerOnline/PlayerOnline',
|
||||
($0.PlayerOnlineReq value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) => $0.PlayerOnlineReply.fromBuffer(value));
|
||||
static final _$premiereInfo = $grpc.ClientMethod<$0.PremiereInfoReq, $0.PremiereInfoReply>(
|
||||
'/bilibili.app.playeronline.v1.PlayerOnline/PremiereInfo',
|
||||
($0.PremiereInfoReq value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) => $0.PremiereInfoReply.fromBuffer(value));
|
||||
static final _$reportWatch = $grpc.ClientMethod<$0.ReportWatchReq, $0.NoReply>(
|
||||
'/bilibili.app.playeronline.v1.PlayerOnline/ReportWatch',
|
||||
($0.ReportWatchReq value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) => $0.NoReply.fromBuffer(value));
|
||||
|
||||
PlayerOnlineClient($grpc.ClientChannel channel,
|
||||
{$grpc.CallOptions? options,
|
||||
$core.Iterable<$grpc.ClientInterceptor>? interceptors})
|
||||
: super(channel, options: options,
|
||||
interceptors: interceptors);
|
||||
|
||||
$grpc.ResponseFuture<$0.PlayerOnlineReply> playerOnline($0.PlayerOnlineReq request, {$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$playerOnline, request, options: options);
|
||||
}
|
||||
|
||||
$grpc.ResponseFuture<$0.PremiereInfoReply> premiereInfo($0.PremiereInfoReq request, {$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$premiereInfo, request, options: options);
|
||||
}
|
||||
|
||||
$grpc.ResponseFuture<$0.NoReply> reportWatch($0.ReportWatchReq request, {$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$reportWatch, request, options: options);
|
||||
}
|
||||
}
|
||||
|
||||
@$pb.GrpcServiceName('bilibili.app.playeronline.v1.PlayerOnline')
|
||||
abstract class PlayerOnlineServiceBase extends $grpc.Service {
|
||||
$core.String get $name => 'bilibili.app.playeronline.v1.PlayerOnline';
|
||||
|
||||
PlayerOnlineServiceBase() {
|
||||
$addMethod($grpc.ServiceMethod<$0.PlayerOnlineReq, $0.PlayerOnlineReply>(
|
||||
'PlayerOnline',
|
||||
playerOnline_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) => $0.PlayerOnlineReq.fromBuffer(value),
|
||||
($0.PlayerOnlineReply value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.PremiereInfoReq, $0.PremiereInfoReply>(
|
||||
'PremiereInfo',
|
||||
premiereInfo_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) => $0.PremiereInfoReq.fromBuffer(value),
|
||||
($0.PremiereInfoReply value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.ReportWatchReq, $0.NoReply>(
|
||||
'ReportWatch',
|
||||
reportWatch_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) => $0.ReportWatchReq.fromBuffer(value),
|
||||
($0.NoReply value) => value.writeToBuffer()));
|
||||
}
|
||||
|
||||
$async.Future<$0.PlayerOnlineReply> playerOnline_Pre($grpc.ServiceCall call, $async.Future<$0.PlayerOnlineReq> request) async {
|
||||
return playerOnline(call, await request);
|
||||
}
|
||||
|
||||
$async.Future<$0.PremiereInfoReply> premiereInfo_Pre($grpc.ServiceCall call, $async.Future<$0.PremiereInfoReq> request) async {
|
||||
return premiereInfo(call, await request);
|
||||
}
|
||||
|
||||
$async.Future<$0.NoReply> reportWatch_Pre($grpc.ServiceCall call, $async.Future<$0.ReportWatchReq> request) async {
|
||||
return reportWatch(call, await request);
|
||||
}
|
||||
|
||||
$async.Future<$0.PlayerOnlineReply> playerOnline($grpc.ServiceCall call, $0.PlayerOnlineReq request);
|
||||
$async.Future<$0.PremiereInfoReply> premiereInfo($grpc.ServiceCall call, $0.PremiereInfoReq request);
|
||||
$async.Future<$0.NoReply> reportWatch($grpc.ServiceCall call, $0.ReportWatchReq request);
|
||||
}
|
||||
104
lib/grpc/app/playeronline/v1/playeronline.pbjson.dart
Normal file
104
lib/grpc/app/playeronline/v1/playeronline.pbjson.dart
Normal file
@@ -0,0 +1,104 @@
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: playeronline.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use noReplyDescriptor instead')
|
||||
const NoReply$json = {
|
||||
'1': 'NoReply',
|
||||
};
|
||||
|
||||
/// Descriptor for `NoReply`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List noReplyDescriptor = $convert.base64Decode(
|
||||
'CgdOb1JlcGx5');
|
||||
|
||||
@$core.Deprecated('Use playerOnlineReplyDescriptor instead')
|
||||
const PlayerOnlineReply$json = {
|
||||
'1': 'PlayerOnlineReply',
|
||||
'2': [
|
||||
{'1': 'total_text', '3': 1, '4': 1, '5': 9, '10': 'totalText'},
|
||||
{'1': 'sec_next', '3': 2, '4': 1, '5': 3, '10': 'secNext'},
|
||||
{'1': 'bottom_show', '3': 3, '4': 1, '5': 8, '10': 'bottomShow'},
|
||||
{'1': 'sdm_show', '3': 4, '4': 1, '5': 8, '10': 'sdmShow'},
|
||||
{'1': 'sdm_text', '3': 5, '4': 1, '5': 9, '10': 'sdmText'},
|
||||
{'1': 'total_number', '3': 6, '4': 1, '5': 3, '10': 'totalNumber'},
|
||||
{'1': 'total_number_text', '3': 7, '4': 1, '5': 9, '10': 'totalNumberText'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `PlayerOnlineReply`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List playerOnlineReplyDescriptor = $convert.base64Decode(
|
||||
'ChFQbGF5ZXJPbmxpbmVSZXBseRIdCgp0b3RhbF90ZXh0GAEgASgJUgl0b3RhbFRleHQSGQoIc2'
|
||||
'VjX25leHQYAiABKANSB3NlY05leHQSHwoLYm90dG9tX3Nob3cYAyABKAhSCmJvdHRvbVNob3cS'
|
||||
'GQoIc2RtX3Nob3cYBCABKAhSB3NkbVNob3cSGQoIc2RtX3RleHQYBSABKAlSB3NkbVRleHQSIQ'
|
||||
'oMdG90YWxfbnVtYmVyGAYgASgDUgt0b3RhbE51bWJlchIqChF0b3RhbF9udW1iZXJfdGV4dBgH'
|
||||
'IAEoCVIPdG90YWxOdW1iZXJUZXh0');
|
||||
|
||||
@$core.Deprecated('Use playerOnlineReqDescriptor instead')
|
||||
const PlayerOnlineReq$json = {
|
||||
'1': 'PlayerOnlineReq',
|
||||
'2': [
|
||||
{'1': 'aid', '3': 1, '4': 1, '5': 3, '10': 'aid'},
|
||||
{'1': 'cid', '3': 2, '4': 1, '5': 3, '10': 'cid'},
|
||||
{'1': 'play_open', '3': 3, '4': 1, '5': 8, '10': 'playOpen'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `PlayerOnlineReq`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List playerOnlineReqDescriptor = $convert.base64Decode(
|
||||
'Cg9QbGF5ZXJPbmxpbmVSZXESEAoDYWlkGAEgASgDUgNhaWQSEAoDY2lkGAIgASgDUgNjaWQSGw'
|
||||
'oJcGxheV9vcGVuGAMgASgIUghwbGF5T3Blbg==');
|
||||
|
||||
@$core.Deprecated('Use premiereInfoReplyDescriptor instead')
|
||||
const PremiereInfoReply$json = {
|
||||
'1': 'PremiereInfoReply',
|
||||
'2': [
|
||||
{'1': 'premiere_over_text', '3': 1, '4': 1, '5': 9, '10': 'premiereOverText'},
|
||||
{'1': 'participant', '3': 2, '4': 1, '5': 3, '10': 'participant'},
|
||||
{'1': 'interaction', '3': 3, '4': 1, '5': 3, '10': 'interaction'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `PremiereInfoReply`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List premiereInfoReplyDescriptor = $convert.base64Decode(
|
||||
'ChFQcmVtaWVyZUluZm9SZXBseRIsChJwcmVtaWVyZV9vdmVyX3RleHQYASABKAlSEHByZW1pZX'
|
||||
'JlT3ZlclRleHQSIAoLcGFydGljaXBhbnQYAiABKANSC3BhcnRpY2lwYW50EiAKC2ludGVyYWN0'
|
||||
'aW9uGAMgASgDUgtpbnRlcmFjdGlvbg==');
|
||||
|
||||
@$core.Deprecated('Use premiereInfoReqDescriptor instead')
|
||||
const PremiereInfoReq$json = {
|
||||
'1': 'PremiereInfoReq',
|
||||
'2': [
|
||||
{'1': 'aid', '3': 1, '4': 1, '5': 3, '10': 'aid'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `PremiereInfoReq`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List premiereInfoReqDescriptor = $convert.base64Decode(
|
||||
'Cg9QcmVtaWVyZUluZm9SZXESEAoDYWlkGAEgASgDUgNhaWQ=');
|
||||
|
||||
@$core.Deprecated('Use reportWatchReqDescriptor instead')
|
||||
const ReportWatchReq$json = {
|
||||
'1': 'ReportWatchReq',
|
||||
'2': [
|
||||
{'1': 'aid', '3': 1, '4': 1, '5': 3, '10': 'aid'},
|
||||
{'1': 'biz', '3': 2, '4': 1, '5': 9, '10': 'biz'},
|
||||
{'1': 'buvid', '3': 3, '4': 1, '5': 9, '10': 'buvid'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ReportWatchReq`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List reportWatchReqDescriptor = $convert.base64Decode(
|
||||
'Cg5SZXBvcnRXYXRjaFJlcRIQCgNhaWQYASABKANSA2FpZBIQCgNiaXoYAiABKAlSA2JpehIUCg'
|
||||
'VidXZpZBgDIAEoCVIFYnV2aWQ=');
|
||||
|
||||
Reference in New Issue
Block a user