CrabtreeOn,印度客户定制APP,迁移2.0平台版本
1
wxr
2023-03-31 d53e6af2c5f17838fa79659614b15a2a1f383399
Crabtree/SmartHome/HDL/Common/HttpUtil/HttpServerRequest.cs
@@ -292,6 +292,26 @@
            return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_UpdateMemberInfo, requestJson);
        }
        /// <summary>
        /// 标记2.0平台数据
        /// </summary>
        /// <returns></returns>
        public bool Mark (string newHomeId)
        {
            Dictionary<string, object> dic = new Dictionary<string, object> ();
            dic.Add ("homeId", newHomeId);
            dic.Add ("mark", true);
            var requestJson = HttpUtil.GetSignRequestJson (dic);
            var revertObj = HttpUtil.RequestHttpsPost (NewAPI.API_Post_Mark, requestJson);
            if (revertObj != null) {
                if (revertObj.Code == "0") {
                        UserConfig.Instance.CurrentRegion.indiaIsAsyncDeviceMark = true;
                        return true;
                }
            }
            return false;
        }
        ///// <summary>
        ///// 更新用户头像
        ///// </summary>
@@ -358,14 +378,14 @@
        #endregion
        #region * 住宅部分___________________________
        ///// <summary>
        ///// 获取住宅列表
        ///// </summary>
        //public ResponsePackNew GetHomeList (HomeTypeEnum homeType = HomeTypeEnum.BUSPRO)
        //{
        //    var requestJson = HttpUtil.GetSignRequestJson (new GetHomeListObj () { homeType = homeType.ToString () });
        //    return HttpUtil.RequestHttpsPost (NewAPI.API_POST_Gethomepager, requestJson);
        //}
        /// <summary>
        /// 获取住宅列表
        /// </summary>
        public ResponsePackNew GetHomeList (HomeTypeEnum homeType = HomeTypeEnum.BUSPRO)
        {
            var requestJson = HttpUtil.GetSignRequestJson (new GetHomeListObj () { homeType = homeType.ToString () });
            return HttpUtil.RequestHttpsPost (NewAPI.API_POST_Gethomepager, requestJson);
        }
        /// <summary>
        /// 获取住宅列表
        /// </summary>
@@ -426,6 +446,9 @@
                isRemoteControl = mHome.isRemoteControl,
                isBindGateway = mHome.isBindGateway,
                regionUrl = mHome.regionUrl,
                debugStaffUserId = mHome.debugStaffUserId,
                debugPerm = mHome.debugPerm,
                indiaIsAsyncDeviceMark = mHome.indiaIsAsyncDeviceMark
            };
        }
@@ -636,6 +659,53 @@
            });
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson);
        }
        #endregion
        #region 调试人员管理
        /// <summary>
        /// 添加调试人员
        /// </summary>
        /// <param name="account">添加调试人员账号</param>
        /// <returns></returns>
        public ResponsePackNew AddDebugStaff (string account)
        {
            Dictionary<string, object> d = new Dictionary<string, object> ();
            d.Add ("homeId", UserConfig.Instance.CurrentRegion.Id);
            d.Add ("account", account);
            var requestJson = HttpUtil.GetSignRequestJson (d);
            return HttpUtil.RequestHttpsPostFroHome (NewAPI.API_POST_DebugStaff_ADD, requestJson);
        }
        /// <summary>
        /// 删除调试人员
        /// </summary>
        /// <param name="account">添加调试人员账号</param>
        /// <returns></returns>
        public ResponsePackNew DelDebugStaff ()
        {
            Dictionary<string, object> d = new Dictionary<string, object> ();
            d.Add ("homeId", UserConfig.Instance.CurrentRegion.Id);
            var requestJson = HttpUtil.GetSignRequestJson (d);
            return HttpUtil.RequestHttpsPostFroHome (NewAPI.API_POST_DebugStaff_DELETE, requestJson);
        }
        /// <summary>
        /// 添加调试人员
        /// </summary>
        /// <param name="account">添加调试人员账号</param>
        /// <returns></returns>
        public ResponsePackNew UpdateDebugPerm (bool debugPerm)
        {
            Dictionary<string, object> d = new Dictionary<string, object> ();
            d.Add ("homeId", UserConfig.Instance.CurrentRegion.Id);
            d.Add ("debugPerm", debugPerm);
            var requestJson = HttpUtil.GetSignRequestJson (d);
            return HttpUtil.RequestHttpsPostFroHome (NewAPI.API_POST_DebugStaff_UPDATE, requestJson);
        }
        #endregion
        #region 新数据分享
@@ -953,6 +1023,21 @@
            return HttpUtil.RequestHttpsPostFroHome (NewAPI.API_POST_Speaker_DeviceList_Update, requestJson);
        }
        #endregion
        /// <summary>
        /// 申请设备密钥
        /// </summary>
        /// <param name="mac"></param>
        /// <returns></returns>
        public ResponsePackNew ApplyDeviceSecret (string mac)
        {
            Dictionary<string, object> d = new Dictionary<string, object> ();
            d.Add ("supplier", "HDL");
            d.Add ("mac", mac);
            d.Add ("spk", "BUSUDPGATEWAY");
            var requestJson = HttpUtil.GetSignRequestJson (d);
            return HttpUtil.RequestHttpsPostFroHome (NewAPI.Api_Post_ApplyDeviceSecret, requestJson);
        }
        //#region Kaede --设备功能——————————————————————————————————
        ///// <summary>
@@ -1346,5 +1431,23 @@
        //}
        //#endregion
        /// <summary>
        /// 修改设备备注
        /// </summary>
        /// <param name="deviceId"></param>
        /// <param name="homeId"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public ResponsePackNew EditDeviceName (string deviceId,string homeId,string name)
        {
            var d = new Dictionary<string, object> ();
            d.Add ("deviceId", deviceId);
            d.Add ("homeId", homeId);
            d.Add ("name", name);
            var requestJson = HttpUtil.GetSignRequestJson (d);
            var pack = HttpUtil.RequestHttpsPostFroHome (NewAPI.Api_Post_EditDeviceName, requestJson);
            return pack;
        }
    }
}