| | |
| | | } |
| | | } |
| | | public List<Face> faceList = new List<Face>(); |
| | | public List<Face> VideoDoorLockUserListInfo = new List<Face>(); |
| | | /// <summary> |
| | | /// 调用获取住宅子账号列表 |
| | | /// </summary> |
| | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取住宅已录入人脸信息 |
| | | /// </summary> |
| | | /// <param name="deviceId">可视对讲设备id</param> |
| | | /// <returns></returns> |
| | | public List<Face> GetHomeFaceList(string deviceId, bool isTip) |
| | | { |
| | | var jObject = new JObject(); |
| | | jObject.Add("homeId", LogicMethod.Current.HomeId); |
| | | jObject.Add("deviceId", deviceId); |
| | | var responsePackNew = RequestServerhomeId(jObject, NewAPI.Api_Post_GetListHomeFace, "获取住宅已录入人脸信息"); |
| | | //如果是token过期则刷新token |
| | | if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) |
| | | { |
| | | RefreshToken(); |
| | | GetListHomeFace(deviceId, isTip); |
| | | } |
| | | if (Check(responsePackNew, isTip) == false) |
| | | { |
| | | return new List<Face>(); |
| | | } |
| | | var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Face>>(responsePackNew.Data.ToString()); |
| | | if (list == null) |
| | | { |
| | | list = new List<Face>(); |
| | | } |
| | | faceList.Clear(); |
| | | faceList.AddRange(list); |
| | | return list; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取门锁用户列表(萤石视频门锁) |
| | | /// </summary> |
| | | /// <param name="deviceId">设备</param> |
| | | /// <returns></returns> |
| | | public List<Face> GetVideoDoorLockUserListInfo(Function device) |
| | | { |
| | | var userList = FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetVideoDoorLockUserListInfo(device); |
| | | List<Face> faceIdList = new List<Face>(); |
| | | for (int i = 0; i < userList.Count; i++) |
| | | { |
| | | Face face = new Face(); |
| | | var user = userList[i]; |
| | | face.userId = user.extUserId; |
| | | face.userName = user.extUserName; |
| | | faceIdList.Add(face); |
| | | } |
| | | VideoDoorLockUserListInfo.Clear(); |
| | | VideoDoorLockUserListInfo.AddRange(faceIdList); |
| | | return faceIdList; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | ///请求服务器(与住宅有关:例如;homeId) |
| | | /// </summary> |