public IActionResult RefreshFactor([FromBody] FactorReq factor)
 {
     try
     {
         var reply = Client.RefreshFactor(factor);
         return(Json(new JsonResultModel(ReturnCode.Success, "Two factor information refreshed successful.")));
     }
     catch (RpcException ex)
     {
         return(Json(new JsonResultModel(ReturnCode.SubmitError, ex.Status.Detail)));
     }
 }
        public IActionResult GenerateFactor([FromBody] FactorReq factor)
        {
            try
            {
                var reply = Client.GenerateFactor(factor);

                return(Json(new JsonResultModel(ReturnCode.Success, "Generate two factor information successful.", reply)));
            }
            catch (RpcException ex)
            {
                return(Json(new JsonResultModel(ReturnCode.SubmitError, ex.Status.Detail)));
            }
        }
        public IActionResult QueryFactor([FromQuery] FactorReq factor)
        {
            try
            {
                var reply = Client.QueryFactor(factor);
                if (reply.Id == 0)
                {
                    reply = null;
                }

                return(Json(new JsonResultModel(ReturnCode.Success, "Query successful.", reply)));
            }
            catch (RpcException ex)
            {
                return(Json(new JsonResultModel(ReturnCode.QueryError, ex.Status.Detail)));
            }
        }