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.

265 lines
8.1 KiB
C#

using HuizhongLibrary.Safety;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HuizhongLibrary.UFace
{
#region 鉴权
public class UFace_Auth
{
public string appId { get; set; }
public string appKey { get; set; }
public string timestamp { get; set; }
public string sign { get; set; }
#region 创建签名
public void CreateSign(string appSecret)
{
timestamp =Convert.ToString(CustomIO.GetTimeStamp(DateTime.Now));
string str = appKey + timestamp + appSecret;
sign=CryptoPublic.Md5For32(str);
}
#endregion
}
#endregion
#region 鉴权结果
public class UFace_Auth_Result
{
public string code { get; set; }
public string data { get; set; }
public string msg { get; set; }
public int result { get; set; }
}
#endregion
#region 创建设备
public class UFace_Device
{
public string appId { get; set; }
public string token { get; set; }
public string deviceKey { get; set; }
public string name { get; set; }
public string tag { get; set; }
}
#endregion
#region 创建设备结果
public class UFace_Device_Result: UFace_Auth_Result
{
public string appId { get; set; }
public string deviceKey { get; set; }
public string name { get; set; }
public string sceneGuid { get; set; }
public string tag { get; set; }
}
#endregion
#region 设备列表查询
public class UFace_Device_Search
{
public string appId { get; set; }
public string token { get; set; }
public int index { get; set; }
public int length { get; set; }
public UFace_Device_Search()
{
length = 100;
}
}
#endregion
#region 设备列表查询结果
public class UFace_Device_Search_Result : UFace_Auth_Result
{
public UFace_Device_Search_Result_data data{get;set;}
}
public class UFace_Device_Search_Result_data
{
public List<UFace_Device_Search_Result_DeviceInfo> content { get; set; }
public UFace_Device_Search_Result_Pagination pagination { get; set; }
}
public class UFace_Device_Search_Result_DeviceInfo
{
/// <summary>
/// 设备序列号
/// </summary>
public string deviceKey { get; set; }
/// <summary>
/// 设备名称
/// </summary>
public string name { get; set; }
/// <summary>
/// 设备状态1未绑定2绑定中3解绑中4未同步5同步中6已同步7已禁用8禁用中9启用中
/// </summary>
public int state { get; set; }
/// <summary>
/// 设备网络状态1在线2离线
/// </summary>
public int status { get; set; }
/// <summary>
/// 设备应用版本号
/// </summary>
public string versionNo { get; set; }
/// <summary>
/// 设备系统版本号
/// </summary>
public string systemVersionNo { get; set; }
/// <summary>
/// 是否需要系统升级
/// </summary>
public bool needUpgradeSystem { get; set; }
/// <summary>
/// 是否需要APP升级
/// </summary>
public bool needUpgradeApp { get; set; }
/// <summary>
/// 是否需要升级包括系统和APP升级
/// </summary>
public bool needUpgrade { get; set; }
public UFace_Device_Search_Result_DeviceInfo Copy()
{
var model = new UFace_Device_Search_Result_DeviceInfo();
model.deviceKey = deviceKey;
model.name = name;
model.state = state;
model.status = status;
model.versionNo = versionNo;
model.systemVersionNo = systemVersionNo;
model.needUpgradeSystem = needUpgradeSystem;
model.needUpgradeApp = needUpgradeApp;
model.needUpgrade = needUpgrade;
return model;
}
}
public class UFace_Device_Search_Result_Pagination
{
/// <summary>
/// 总条目数
/// </summary>
public int total { get; set; }
/// <summary>
/// 总页数
/// </summary>
public int size { get; set; }
/// <summary>
/// 当前页数
/// </summary>
public int index { get; set; }
/// <summary>
/// 每页最大显示数量默认5
/// </summary>
public int length { get; set; }
/// <summary>
/// 分页开始条目于总数位置
/// </summary>
public int beginIndex { get; set; }
/// <summary>
/// 分页结束条目于总数位置
/// </summary>
public int endIndex { get; set; }
}
#endregion
#region 人员新增
public class UFace_Person
{
public string appId { get; set; }
public string token { get; set; }
public string name { get; set; }
public string idNo { get; set; }
public string phone { get; set; }
public string tag { get; set; }
public int type { get; set; }
public string idcardNo { get; set; }
}
#endregion
#region 人员新增_结果
public class UFace_Person_Result : UFace_Auth_Result
{
public UFace_Person_Info data { get; set; }
}
public class UFace_Person_Info
{
public string guid { get; set; }
public string userGuid { get; set; }
public string phone { get; set; }
public string idNo { get; set; }
public string tag { get; set; }
public int type { get; set; }
public string name { get; set; }
}
#endregion
#region 人员新增
public class UFace_Person_Delete
{
public string appId { get; set; }
public string token { get; set; }
public string guid { get; set; }
}
#endregion
#region 人员更新
public class UFace_Person_Update
{
public string appId { get; set; }
public string token { get; set; }
public string guid { get; set; }
public string name { get; set; }
public string idNo { get; set; }
public string phone { get; set; }
public string tag { get; set; }
public string type { get; set; }
public string idcardNo { get; set; }
}
#endregion
#region 人员设备授权
public class UFace_PersonPermission
{
public string appId { get; set; }
public string token { get; set; }
public string guid { get; set; }
public string deviceKeys { get; set; }
public string passTimes { get; set; }
public string effectiveTime { get; set; }
public int facePermission { get; set; }
public int cardPermission { get; set; }
public int cardFacePermission { get; set; }
public int idcardFacePermission { get; set; }
}
#endregion
#region 人员设备消权
public class UFace_PersonPermission_Delete
{
public string appId { get; set; }
public string token { get; set; }
public string guid { get; set; }
public string deviceKey { get; set; }
}
#endregion
#region 照片上传
public class UFace_Photo
{
public string appId { get; set; }
public string token { get; set; }
public string guid { get; set; }
public string img { get; set; }
public byte type { get; set; }
public int validLevel { get; set; }
}
#endregion
#region 照片上传结果
public class UFace_Photo_Result : UFace_Auth_Result
{
public UFace_Photo_Result_data data { get; set; }
}
public class UFace_Photo_Result_data
{
public string appId { get; set; }
public string guid { get; set; }
public string userGuid { get; set; }
public string personGuid { get; set; }
public int type { get; set; }
public string faceUrl { get; set; }
}
#endregion
}