public async Task <RpcResult <VoidRsp> > AddAPaperCountAsync(AddAPaperReq req, int timeOut = 3000) { AmpMessage message = AmpMessage.CreateRequestMessage(20001, 5); message.FriendlyServiceName = "QPaperInnerService.AddAPaperCount"; message.Data = req.ToByteArray(); var response = await base.CallInvoker.AsyncCall(message, timeOut); if (response == null) { throw new RpcException("error,response is null !"); } var result = new RpcResult <VoidRsp>(); if (response.Code != 0) { result.Code = response.Code; } else if (response.Data == null) { result.Code = ErrorCodes.CODE_INTERNAL_ERROR; } else { result.Data = VoidRsp.Parser.ParseFrom(response.Data); } return(result); }
//同步方法 public RpcResult <VoidRsp> AddAPaperCount(AddAPaperReq req) { AmpMessage message = AmpMessage.CreateRequestMessage(20001, 5); message.FriendlyServiceName = "QPaperService.AddAPaperCount"; message.Data = req.ToByteArray(); var response = base.CallInvoker.BlockingCall(message); if (response == null) { throw new RpcException("error,response is null !"); } var result = new RpcResult <VoidRsp>(); if (response.Code != 0) { result.Code = response.Code; } if (response.Data == null) { result.Data = new VoidRsp(); } else { result.Data = VoidRsp.Parser.ParseFrom(response.Data); } return(result); }