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.

92 lines
2.3 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* 版权所有 (c) 2025 WenJY 保留所有权利。
* CLR版本4.0.30319.42000
* 机器名称Mr.Wen's MacBook Pro
* 命名空间Sln.Iot.Model.dto
* 唯一标识A23DD86E-3AEA-42E2-98A4-97FD9BCD19ED
*
* 创建者WenJY
* 电子邮箱:
* 创建时间2025-05-09 15:39:12
* 版本V1.0.0
* 描述:
*
*--------------------------------------------------------------------
* 修改人:
* 时间:
* 修改说明:
*
* 版本V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace Sln.Iot.Model.dto
{
/// <summary>
/// API结果
/// </summary>
public class ApiResInfo
{
/// <summary>
/// 状态码200-OK500-失败/异常
/// </summary>
public int code { get; set; }
/// <summary>
/// 是否成功T-成功F-失败
/// </summary>
public bool isSuc { get; set; }
/// <summary>
/// 返回信息
/// </summary>
public string msg { get; set; }
/// <summary>
/// 设备指令
/// </summary>
public byte[] buffer { get; set; }
/// <summary>
/// 设备数据封装
/// </summary>
public object data { get; set; }
/// <summary>
/// 成功
/// </summary>
/// <param name="msg"></param>
/// <param name="data"></param>
/// <returns></returns>
public static ApiResInfo Success(string msg,object data = null)
{
return new ApiResInfo()
{
code = 200,
isSuc = true,
msg = msg,
data = data
};
}
/// <summary>
/// 失败
/// </summary>
/// <param name="msg"></param>
/// <param name="data"></param>
/// <returns></returns>
public static ApiResInfo Fail(string msg,object data = null)
{
return new ApiResInfo()
{
code = 500,
isSuc = false,
msg = msg,
data = data
};
}
}
}