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 content { get; set; } public UFace_Device_Search_Result_Pagination pagination { get; set; } } public class UFace_Device_Search_Result_DeviceInfo { /// /// 设备序列号 /// public string deviceKey { get; set; } /// /// 设备名称 /// public string name { get; set; } /// /// 设备状态,1:未绑定,2:绑定中,3:解绑中,4:未同步,5:同步中,6:已同步,7:已禁用,8:禁用中,9:启用中 /// public int state { get; set; } /// /// 设备网络状态,1:在线,2:离线 /// public int status { get; set; } /// /// 设备应用版本号 /// public string versionNo { get; set; } /// /// 设备系统版本号 /// public string systemVersionNo { get; set; } /// /// 是否需要系统升级 /// public bool needUpgradeSystem { get; set; } /// /// 是否需要APP升级 /// public bool needUpgradeApp { get; set; } /// /// 是否需要升级(包括系统和APP升级) /// 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 { /// /// 总条目数 /// public int total { get; set; } /// /// 总页数 /// public int size { get; set; } /// /// 当前页数 /// public int index { get; set; } /// /// 每页最大显示数量,默认5 /// public int length { get; set; } /// /// 分页开始条目于总数位置 /// public int beginIndex { get; set; } /// /// 分页结束条目于总数位置 /// 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 }