| abstract class TestServiceBase extends GeneratedService { |
| Future<SomeReply> aMethod(ServerContext ctx, SomeRequest request); |
| Future<$foo$bar.AnotherReply> anotherMethod(ServerContext ctx, $foo$bar.EmptyMessage request); |
| |
| GeneratedMessage createRequest(String method) { |
| switch (method) { |
| case 'AMethod': return new SomeRequest(); |
| case 'AnotherMethod': return new $foo$bar.EmptyMessage(); |
| default: throw new ArgumentError('Unknown method: $method'); |
| } |
| } |
| |
| Future<GeneratedMessage> handleCall(ServerContext ctx, String method, GeneratedMessage request) { |
| switch (method) { |
| case 'AMethod': return this.aMethod(ctx, request); |
| case 'AnotherMethod': return this.anotherMethod(ctx, request); |
| default: throw new ArgumentError('Unknown method: $method'); |
| } |
| } |
| |
| Map<String, dynamic> get $json => Test$json; |
| Map<String, Map<String, dynamic>> get $messageJson => Test$messageJson; |
| } |
| |