mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-23 06:33:43 +08:00
移除 grpc
This commit is contained in:
parent
e1d3ccc4a8
commit
1e53bf3d1a
@ -1,20 +0,0 @@
|
||||
import 'package:starcitizen_doctor/common/grpc/grpc.dart';
|
||||
import 'package:starcitizen_doctor/generated/grpc/app.pbgrpc.dart';
|
||||
|
||||
import '../common/utils/base_utils.dart';
|
||||
|
||||
class GrpcApi {
|
||||
static final _pingClient = PingServiceClient(GrpcClient.channel);
|
||||
|
||||
static Future pingServer() async {
|
||||
try {
|
||||
final result = await _pingClient.pingServer(PingRequest(name: "ping"));
|
||||
if (result.pong == "pong") {
|
||||
dPrint("[GrpcApi] gRPC service Connected");
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
dPrint("[GrpcApi] pingServer Error: $e");
|
||||
}
|
||||
}
|
||||
}
|
@ -8,7 +8,6 @@ import 'package:hive/hive.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:starcitizen_doctor/api/analytics.dart';
|
||||
import 'package:starcitizen_doctor/api/api.dart';
|
||||
import 'package:starcitizen_doctor/api/grpc_api.dart';
|
||||
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
|
||||
import 'package:starcitizen_doctor/common/rust/ffi.dart';
|
||||
import 'package:starcitizen_doctor/data/app_version_data.dart';
|
||||
@ -134,7 +133,6 @@ class AppConf {
|
||||
}
|
||||
|
||||
static Future<void> checkUpdate() async {
|
||||
GrpcApi.pingServer();
|
||||
// clean path
|
||||
if (!isMSE) {
|
||||
final dir = Directory(getUpgradePath());
|
||||
|
@ -1,118 +0,0 @@
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: app.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:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class PingRequest extends $pb.GeneratedMessage {
|
||||
factory PingRequest({
|
||||
$core.String? name,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (name != null) {
|
||||
$result.name = name;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
PingRequest._() : super();
|
||||
factory PingRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory PingRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PingRequest', createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'name')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
PingRequest clone() => PingRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
PingRequest copyWith(void Function(PingRequest) updates) => super.copyWith((message) => updates(message as PingRequest)) as PingRequest;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PingRequest create() => PingRequest._();
|
||||
PingRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<PingRequest> createRepeated() => $pb.PbList<PingRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PingRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<PingRequest>(create);
|
||||
static PingRequest? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get name => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set name($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasName() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearName() => clearField(1);
|
||||
}
|
||||
|
||||
class PingResult extends $pb.GeneratedMessage {
|
||||
factory PingResult({
|
||||
$core.String? pong,
|
||||
}) {
|
||||
final $result = create();
|
||||
if (pong != null) {
|
||||
$result.pong = pong;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
PingResult._() : super();
|
||||
factory PingResult.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory PingResult.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PingResult', createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'pong')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
PingResult clone() => PingResult()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
PingResult copyWith(void Function(PingResult) updates) => super.copyWith((message) => updates(message as PingResult)) as PingResult;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PingResult create() => PingResult._();
|
||||
PingResult createEmptyInstance() => create();
|
||||
static $pb.PbList<PingResult> createRepeated() => $pb.PbList<PingResult>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static PingResult getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<PingResult>(create);
|
||||
static PingResult? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get pong => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set pong($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasPong() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearPong() => clearField(1);
|
||||
}
|
||||
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names');
|
@ -1,11 +0,0 @@
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: app.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
|
||||
|
@ -1,59 +0,0 @@
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: app.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 'app.pb.dart' as $0;
|
||||
|
||||
export 'app.pb.dart';
|
||||
|
||||
@$pb.GrpcServiceName('PingService')
|
||||
class PingServiceClient extends $grpc.Client {
|
||||
static final _$pingServer = $grpc.ClientMethod<$0.PingRequest, $0.PingResult>(
|
||||
'/PingService/PingServer',
|
||||
($0.PingRequest value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) => $0.PingResult.fromBuffer(value));
|
||||
|
||||
PingServiceClient($grpc.ClientChannel channel,
|
||||
{$grpc.CallOptions? options,
|
||||
$core.Iterable<$grpc.ClientInterceptor>? interceptors})
|
||||
: super(channel, options: options,
|
||||
interceptors: interceptors);
|
||||
|
||||
$grpc.ResponseFuture<$0.PingResult> pingServer($0.PingRequest request, {$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$pingServer, request, options: options);
|
||||
}
|
||||
}
|
||||
|
||||
@$pb.GrpcServiceName('PingService')
|
||||
abstract class PingServiceBase extends $grpc.Service {
|
||||
$core.String get $name => 'PingService';
|
||||
|
||||
PingServiceBase() {
|
||||
$addMethod($grpc.ServiceMethod<$0.PingRequest, $0.PingResult>(
|
||||
'PingServer',
|
||||
pingServer_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) => $0.PingRequest.fromBuffer(value),
|
||||
($0.PingResult value) => value.writeToBuffer()));
|
||||
}
|
||||
|
||||
$async.Future<$0.PingResult> pingServer_Pre($grpc.ServiceCall call, $async.Future<$0.PingRequest> request) async {
|
||||
return pingServer(call, await request);
|
||||
}
|
||||
|
||||
$async.Future<$0.PingResult> pingServer($grpc.ServiceCall call, $0.PingRequest request);
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: app.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 pingRequestDescriptor instead')
|
||||
const PingRequest$json = {
|
||||
'1': 'PingRequest',
|
||||
'2': [
|
||||
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `PingRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List pingRequestDescriptor = $convert.base64Decode(
|
||||
'CgtQaW5nUmVxdWVzdBISCgRuYW1lGAEgASgJUgRuYW1l');
|
||||
|
||||
@$core.Deprecated('Use pingResultDescriptor instead')
|
||||
const PingResult$json = {
|
||||
'1': 'PingResult',
|
||||
'2': [
|
||||
{'1': 'pong', '3': 1, '4': 1, '5': 9, '10': 'pong'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `PingResult`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List pingResultDescriptor = $convert.base64Decode(
|
||||
'CgpQaW5nUmVzdWx0EhIKBHBvbmcYASABKAlSBHBvbmc=');
|
||||
|
@ -64,8 +64,6 @@ dependencies:
|
||||
hexcolor: ^3.0.1
|
||||
dart_rss: ^3.0.1
|
||||
html: ^0.15.4
|
||||
protobuf: ^3.1.0
|
||||
grpc: ^3.2.4
|
||||
|
||||
dependency_overrides:
|
||||
http: ^1.1.2
|
||||
|
@ -1 +0,0 @@
|
||||
protoc --dart_out=grpc:lib/generated/grpc -I../sctoolbox_grpc/protos/ ../sctoolbox_grpc/protos/*.proto
|
Loading…
Reference in New Issue
Block a user