diff --git a/lib/api/grpc/test_auth.dart b/lib/api/grpc/test_auth.dart deleted file mode 100644 index 9ce12fe..0000000 --- a/lib/api/grpc/test_auth.dart +++ /dev/null @@ -1,25 +0,0 @@ -import 'dart:developer'; - -import 'package:grpc/grpc_web.dart'; -import 'package:softplayer_dart_proto/src/test/v1/test_v1.pb.dart'; -import 'package:softplayer_dart_proto/src/test/v1/test_v1.pbgrpc.dart'; - -class TestAuthGrpc { - final GrpcWebClientChannel channel; - late TestAuthServiceClient serviceStub; - TestAuthGrpc({required this.channel}); - - void init() { - serviceStub = TestAuthServiceClient(channel); - } - - Future pong() async { - final request = PongRequest(); - try { - final response = await serviceStub.pong(request); - log(response.toString()); - } catch (e) { - rethrow; - } - } -} diff --git a/lib/api/grpc/test_no_auth.dart b/lib/api/grpc/test_service.dart similarity index 51% rename from lib/api/grpc/test_no_auth.dart rename to lib/api/grpc/test_service.dart index 8abceb6..ba237f3 100644 --- a/lib/api/grpc/test_no_auth.dart +++ b/lib/api/grpc/test_service.dart @@ -4,13 +4,33 @@ import 'package:grpc/grpc_web.dart'; import 'package:softplayer_dart_proto/src/test/v1/test_v1.pb.dart'; import 'package:softplayer_dart_proto/src/test/v1/test_v1.pbgrpc.dart'; +class TestAuthGrpc { + final GrpcWebClientChannel channel; + late TestServiceClient serviceStub; + TestAuthGrpc({required this.channel}); + + void init() { + serviceStub = TestServiceClient(channel); + } + + Future pong() async { + final request = PongRequest(); + try { + final response = await serviceStub.pong(request); + log(response.toString()); + } catch (e) { + rethrow; + } + } +} + class TestNoAuthGrpc { final GrpcWebClientChannel channel; - late TestNoAuthServiceClient serviceStub; + late PublicTestServiceClient serviceStub; TestNoAuthGrpc({required this.channel}); void init() { - serviceStub = TestNoAuthServiceClient(channel); + serviceStub = PublicTestServiceClient(channel); } Future ping() async { diff --git a/lib/main.dart b/lib/main.dart index c69d422..862d115 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,7 +1,6 @@ import 'dart:developer'; -import 'package:softplayer_web/api/grpc/test_auth.dart'; -import 'package:softplayer_web/api/grpc/test_no_auth.dart'; +import 'package:softplayer_web/api/grpc/test_service.dart'; import 'package:web/web.dart' as web; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter/material.dart'; diff --git a/pubspec.lock b/pubspec.lock index 4e2c81d..699d294 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -276,8 +276,8 @@ packages: dependency: "direct main" description: path: "." - ref: d7bdb92492d6986db4ade9e81ff088dee2a6757b - resolved-ref: d7bdb92492d6986db4ade9e81ff088dee2a6757b + ref: a9a7f05332596f776b37d2757b33f06f6faa92e9 + resolved-ref: a9a7f05332596f776b37d2757b33f06f6faa92e9 url: "https://gitea.badhouseplants.net/softplayer/softplayer-dart-proto.git" source: git version: "1.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 589408d..4b2230e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: softplayer_dart_proto: git: url: https://gitea.badhouseplants.net/softplayer/softplayer-dart-proto.git - ref: d7bdb92492d6986db4ade9e81ff088dee2a6757b + ref: a9a7f05332596f776b37d2757b33f06f6faa92e9 cupertino_icons: ^1.0.9 grpc: 5.1.0 http: ^1.6.0