blob: 00f9075e673edec3ec116f486b875fded26d2ed5 [file] [log] [blame]
abstract class TestServiceBase extends GeneratedService {
$async.Future<SomeReply> aMethod(ServerContext ctx, SomeRequest request);
$async.Future<$0.AnotherReply> anotherMethod(ServerContext ctx, $0.EmptyMessage request);
GeneratedMessage createRequest(String method) {
switch (method) {
case 'AMethod': return new SomeRequest();
case 'AnotherMethod': return new $0.EmptyMessage();
default: throw new ArgumentError('Unknown method: $method');
}
}
$async.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;
}