Fix 代码

master
nodyang@aliyun.com 1 month ago
parent f470cf5364
commit 8d5ca99844

@ -16,13 +16,8 @@ namespace SlnMesnac.RfidUpload.Analysis
#region 单例实现 #region 单例实现
private static readonly Lazy<InstructionAdapter> _lazy = new Lazy<InstructionAdapter>(() => new InstructionAdapter()); private static readonly Lazy<InstructionAdapter> _lazy = new Lazy<InstructionAdapter>(() => new InstructionAdapter());
public static InstructionAdapter Instance public static InstructionAdapter Instance => _lazy.Value;
{
get
{
return _lazy.Value;
}
}
#endregion #endregion
private InstructionAdapter() { } private InstructionAdapter() { }

@ -43,7 +43,7 @@ namespace SlnMesnac.RfidUpload.Model.apiParam
public List<T> ToObjectList<T>() public List<T> ToObjectList<T>()
{ {
JObject job = JObject.Parse(body); JObject job = JObject.Parse(body);
string str = job["retBody"]?["object"]?.ToString(); string? str = job["retBody"]?["object"]?.ToString();
if (!string.IsNullOrEmpty(str)) if (!string.IsNullOrEmpty(str))
{ {
List<T> institutionList = JsonConvert.DeserializeObject<List<T>>(str); List<T> institutionList = JsonConvert.DeserializeObject<List<T>>(str);
@ -56,6 +56,18 @@ namespace SlnMesnac.RfidUpload.Model.apiParam
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 code { get; set; }
public string csbCode { get; set; } public string csbCode { get; set; }
public string message { get; set; } public string message { get; set; }

Loading…
Cancel
Save