mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-06-13 14:38:43 +00:00
RPC Test
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Tests.RPC.ThriftServer;
|
||||
|
||||
using Echo.ThriftModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
// using Thrift; // only needed if you reference Thrift exceptions directly
|
||||
|
||||
public sealed class EchoHandler : Echo.ThriftModel.EchoService.IAsync
|
||||
{
|
||||
public Task<byte[]> EchoBytes(byte[] data, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return Task.FromResult(data);
|
||||
}
|
||||
|
||||
public Task<List<BusinessDocument>> EchoDocuments(List<BusinessDocument> docs, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return Task.FromResult(docs);
|
||||
}
|
||||
|
||||
public Task<List<int>> EchoIntArray(List<int> array, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return Task.FromResult(array);
|
||||
}
|
||||
|
||||
public Task<List<string>> EchoStringArray(List<string> array, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return Task.FromResult(array);
|
||||
}
|
||||
|
||||
public Task<Dictionary<string, BusinessDocument>> EchoMap(Dictionary<string, BusinessDocument> map, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return Task.FromResult(map);
|
||||
}
|
||||
|
||||
|
||||
Task<List<DocType>> EchoService.IAsync.EchoEnumArray(List<DocType> docTypes, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult(docTypes);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user