예제 #1
0
        //peer级别

        //[Authorize(Roles = "Peer")]
        public override async Task <NetResponse> Endorse(NetRequest request, ServerCallContext context)
        {
            try
            {
                var model = Newtonsoft.Json.JsonConvert.DeserializeObject <EndorseRequest>(request.Data);
                var rs    = await _txService.Endorse(model);

                return(new NetResponse()
                {
                    Data = Newtonsoft.Json.JsonConvert.SerializeObject(rs)
                });
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, ex.Message);

                var rs = new EndorseResponse();
                rs.Status = false;
                rs.Msg    = ex.Message;
                return(new NetResponse()
                {
                    Data = Newtonsoft.Json.JsonConvert.SerializeObject(rs)
                });
            }
        }
예제 #2
0
        //peer级别

        //[Authorize(Roles = "Peer")]
        public async Task <JsonResult> Endorse(EndorseRequest request)
        {
            var rs = await _txService.Endorse(request);

            return(new JsonResult(rs));
        }