Esempio n. 1
0
        public Task <RpcResult <SayHelloRes> > SayHelloAsync(SayHelloReq req)
        {
            var result = new RpcResult <SayHelloRes>
            {
                Data = new SayHelloRes {
                    Greeting = $"Hello {req.Name},{req.Id}!"
                }
            };

            return(Task.FromResult(result));
        }
Esempio n. 2
0
        public Task <RpcResult <SayHelloRes> > SayHelloAsync(SayHelloReq req)
        {
            var result = new RpcResult <SayHelloRes>
            {
                Code = 0,
                Data = new SayHelloRes {
                    Greeting = $"Hello {req.Name},{req.Id}!", ReturnMessage = "测试换行符\n"
                }
            };

            //throw  new Exception("测试异常");
            return(Task.FromResult(result));
        }