You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
2.6 KiB
C#

2 months ago
using Newtonsoft.Json.Linq;
using System;
2 months ago
using System.Collections.Generic;
2 months ago
using System.Collections.ObjectModel;
2 months ago
using System.Text;
2 months ago
using Newtonsoft.Json;
2 months ago
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.Model.apiParam
* 24151d41-1e82-4326-bab7-94d9a9655cbd
*
* WenJY
*
* 2024-12-06 16:37:58
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.Model.apiParam
{
public class CsbResult
{
2 months ago
// public string status { get; set; }
2 months ago
public string msg { get; set; }
2 months ago
// public List<Object> @object { get; set; }
2 months ago
public bool IsSuccess => status().StartsWith("0");
2 months ago
public List<T> ToObjectList<T>()
{
JObject job = JObject.Parse(body);
2 months ago
string? str = job["retBody"]?["object"]?.ToString();
2 months ago
if (!string.IsNullOrEmpty(str))
{
List<T> institutionList = JsonConvert.DeserializeObject<List<T>>(str);
return institutionList;
}
return new List<T>();
}
2 months ago
public string body { get; set; }
2 months ago
public JObject? GetRetBodyJObject()
{
JObject job = JObject.Parse(body);
var str = job["retBody"];
return str as JObject;
}
2 months ago
public string GetMsg()
{
var job = GetRetBodyJObject();
if (job != null)
{
var s = job?["msg"]?.ToString();
2 months ago
var b = "";
2 months ago
return s +" "+ b??"";
}
return "";
}
2 months ago
public string status()
{
var job = GetRetBodyJObject();
if (job != null)
{
var s = job?["status"]?.ToString();
var b = "";
return s + " " + b ?? "";
}
return "";
}
2 months ago
public string GetRetBody()
{
JObject job = JObject.Parse(body);
string? str = job["retBody"]?.ToString();
if (!string.IsNullOrEmpty(str))
{
return str;
}
2 months ago
return message;
2 months ago
}
2 months ago
2 months ago
// public string code { get; set; }
public string csbCode { get; set; }
public string message { get; set; }
2 months ago
}
}