| | |
| | | { |
| | | if (DB_ResidenceData.Instance.CurrentRegion.id != "") |
| | | { |
| | | Shared.Application.RunOnMainThread(() =>StringId |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | MainPage.GoUserPage(false); |
| | | }); |
| | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | /// <summary> |
| | | /// 获取第三方注册的id |
| | | /// </summary> |
| | | /// <param homeId="homeId">住宅id</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetExtUserId(string homeId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", homeId); |
| | | |
| | | #region ■ 门锁相关____________________________ |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetExtUserId, requestJson); |
| | | |
| | | return pack; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 门锁相关____________________________ |
| | | |
| | | /// <summary> |
| | | /// 获取门锁历史记录(按日期降序) |
| | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 获取群控详情 |
| | | /// </summary> |
| | | public ResponsePackNew GetGroupControInfo(string userDeviceGroupControlIds) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | var ids = new List<string>() |
| | | { |
| | | userDeviceGroupControlIds, |
| | | }; |
| | | d.Add("userDeviceGroupControlIds", ids); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取群控详情 |
| | | /// </summary> |
| | | public ResponsePackNew GetGroupControInfo(List<string> ids) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("userDeviceGroupControlIds", ids); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加群控列表 |
| | | /// </summary> |
| | | /// <param name="spk"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew AddGroupControl(List<GroupControl> groupControls) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | d.Add("infos", groupControls); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 添加群控列表 |
| | | /// </summary> |
| | | public ResponsePackNew DelGroupControl(string groupControlId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId }); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 编辑群控列表 |
| | | /// </summary> |
| | | /// <param name="spk"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew EditGroupControl(List<GroupControl> groupControls) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("infos", groupControls); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 群控控制 |
| | | /// </summary> |
| | | public ResponsePackNew ControlGroupControl(string userDeviceGroupControlId, Dictionary<string, object> pair) |
| | | { |
| | | var d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("userDeviceGroupControlId", userDeviceGroupControlId); |
| | | List<Dictionary<string, object>> dd = new List<Dictionary<string, object>>(); |
| | | dd.Add(pair); |
| | | d.Add("status",dd); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 收藏群控 |
| | | /// </summary> |
| | | public ResponsePackNew CollectGroupControl(string groupControlId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId }); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CollectGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 取消收藏群控 |
| | | /// </summary> |
| | | public ResponsePackNew CancelCollectGroupControl(string groupControlId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId }); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |