From 8d5ca99844332cf3ff8a6e921c671d12aa575051 Mon Sep 17 00:00:00 2001 From: "nodyang@aliyun.com" Date: Fri, 13 Dec 2024 20:49:14 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InstructionAdapter.cs | 9 ++------- SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/SlnMesnac.RfidUpload.Analysis/InstructionAdapter.cs b/SlnMesnac.RfidUpload.Analysis/InstructionAdapter.cs index 2d037d9..ae8b616 100644 --- a/SlnMesnac.RfidUpload.Analysis/InstructionAdapter.cs +++ b/SlnMesnac.RfidUpload.Analysis/InstructionAdapter.cs @@ -16,13 +16,8 @@ namespace SlnMesnac.RfidUpload.Analysis #region 单例实现 private static readonly Lazy _lazy = new Lazy(() => new InstructionAdapter()); - public static InstructionAdapter Instance - { - get - { - return _lazy.Value; - } - } + public static InstructionAdapter Instance => _lazy.Value; + #endregion private InstructionAdapter() { } diff --git a/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs b/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs index d76d2e3..aadd2bf 100644 --- a/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs +++ b/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs @@ -43,7 +43,7 @@ namespace SlnMesnac.RfidUpload.Model.apiParam public List ToObjectList() { JObject job = JObject.Parse(body); - string str = job["retBody"]?["object"]?.ToString(); + string? str = job["retBody"]?["object"]?.ToString(); if (!string.IsNullOrEmpty(str)) { List institutionList = JsonConvert.DeserializeObject>(str); @@ -54,7 +54,19 @@ namespace SlnMesnac.RfidUpload.Model.apiParam return new List(); } - public string body { get; set; } + public string body { get; set; } + + public string GetRetBody() + { + JObject job = JObject.Parse(body); + string? str = job["retBody"]?.ToString(); + if (!string.IsNullOrEmpty(str)) + { + return str; + } + + return ""; + } public string code { get; set; } public string csbCode { get; set; }