HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -544,6 +544,13 @@
                var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoRes>>(resultObj.Data.ToString());
                if (homeList == null || homeList.Count == 0)
                {
                    if (DB_ResidenceData.Instance.CurrentRegion!=null && DB_ResidenceData.Instance.CurrentRegion.id != "")
                    {
                        Shared.Application.RunOnMainThread(() =>
                        {
                            MainPage.GoUserPage(false);
                        });
                    }
                }
                else
                {
@@ -564,6 +571,10 @@
                    }
                    if (UserInfo.Current.regionList.Count == 0)
                    {
                        Shared.Application.RunOnMainThread(() =>
                        {
                            MainPage.GoUserPage(false);
                        });
                        return "null";
                    }
                    //-------如果账号是首次登录
@@ -726,7 +737,7 @@
        {
            var requestObj = new ChildDeleteObj()
            {
                childAccountId = subaccount.childAccountId,
                childId = subaccount.id,
                homeId = subaccount.homeId
            };
            var requestJson = HttpUtil.GetSignRequestJson(requestObj);
@@ -741,12 +752,11 @@
        /// <returns></returns>
        public ResponsePackNew EditSubAccountNickName(string nickName, string childAccountId)
        {
            var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj()
            {
                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
                childAccountId = childAccountId,
                nickName = nickName,
            });
            var d = new Dictionary<string, string>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("childId", childAccountId);
            d.Add("nickName", nickName);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson);
        }
@@ -761,7 +771,7 @@
            var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj()
            {
                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
                childAccountId = childAccountId,
                childId = childAccountId,
                isAllowCreateScene = isAllow,
            });
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson);
@@ -977,10 +987,60 @@
        public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName)
        {
            //添加子账号
            var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.id, account = subAccount, nickName = nickName };
            var requestObj = new ChildAddObj()
            {
                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
                account = subAccount,
                nickName = nickName
            };
            var requestJson = HttpUtil.GetSignRequestJson(requestObj);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson);
        }
        //v1.7更新接口
        public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName,string faceUrl)
        {
            //添加子账号
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("nickName", nickName);
            if (!string.IsNullOrEmpty(subAccount))
            {
                d.Add("account", subAccount);
            }
            if (!string.IsNullOrEmpty(faceUrl))
            {
                d.Add("faceUrl", @"data:image/jpg;base64," + faceUrl);
            }
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson);
        }
        /// <summary>
        /// 删除成员账号人脸数据
        /// </summary>
        /// <param name="subAccount"></param>
        /// <param name="nickName"></param>
        /// <param name="faceUrl"></param>
        /// <returns></returns>
        public ResponsePackNew DeleteMemberFace( string childId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("childId", childId);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_RemoveFace, requestJson);
        }
        /// <summary>
        /// 更新成员账号人脸数据
        /// </summary>
        public ResponsePackNew UpdataMemberFace(string childId, string faceUrl)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("childId", childId);
            d.Add("userFace", @"data:image/jpg;base64," + faceUrl);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_UpdateFace, requestJson);
        }
        /// <summary>
@@ -1523,10 +1583,10 @@
        //}
#endregion
        #endregion
#region 备份部分
        #region 备份部分
        ///// <summary>
        ///// 获取住宅备份列表
        ///// </summary>
@@ -1997,10 +2057,22 @@
        }
        */
#endregion
        #endregion
#region Kaede --设备功能——————————————————————————————————
        #region Kaede --设备功能——————————————————————————————————
        /// <summary>
        /// 获取乐橙子账号token
        /// </summary>
        /// <returns></returns>
        public ResponsePackNew GetLcSubAccountToken()
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetLcSubToken, requestJson);
        }
        /// <summary>
        /// 获取设备列表
        /// </summary>
@@ -2033,8 +2105,10 @@
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("productPlatform", productPlatform);
            d.Add("productBrand", productBrand);
            if (productBrand != "MegaHealth")
            if (productBrand == "MegaHealth" || productBrand == "IMOU")
            {
            }
            else {
                d.Add("networkConfig", true);
            }
@@ -2064,7 +2138,7 @@
        /// <param name="productPlatform"></param>
        /// <param name="productBrand"></param>
        /// <returns></returns>
        public ResponsePackNew IndependentRegister3TyDevcie(string spk, string extDevId, string deviceName, string pairCode = "")
        public ResponsePackNew IndependentRegister3TyDevcie(string spk, string extDevId, string deviceName,string productBrandIdentity, string pairCode = "")
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
@@ -2072,12 +2146,28 @@
            d.Add("extDevId", extDevId);
            d.Add("name", deviceName);
            d.Add("code", pairCode);
            d.Add("productBrandIdentity", productBrandIdentity);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson);
        }
        /// <summary>
        /// 删除第三方设备
        /// </summary>
        /// <returns></returns>
        public ResponsePackNew Delete3tyDevice(string deviceId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceId", deviceId);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var responsePackNew = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Remove3tyDevcie, requestJson);
            return responsePackNew;
        }
@@ -2151,6 +2241,21 @@
            d.Add("name", function.name);
            d.Add("collect", function.collect);
            d.Add("roomIds", function.roomIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
        }
        /// <summary>
        /// 编辑设备信息
        /// 绑定关系、名称、收藏
        /// </summary>
        /// <returns></returns>
        public ResponsePackNew UpdataDevcieName(Function function,string name)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceId", function.deviceId);
            d.Add("name", name);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
@@ -2823,9 +2928,25 @@
        }
#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>
        /// 获取门锁历史记录(按日期降序)
@@ -3027,7 +3148,7 @@
#region 光伏储能
        #region 光伏储能
        /// <summary>
        /// 获取住宅下逆变器列表
        /// </summary>
@@ -3052,7 +3173,55 @@
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetInverter_StatisticsInfo, requestJson);
            return pack;
        }
#endregion
        #endregion
        #region 群控,组合调光
        /// <summary>
        /// 获取群控类型
        /// </summary>
        /// <param name="spk"></param>
        /// <returns></returns>
        public ResponsePackNew GetGroupControlTypes(string spk)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("spk", spk);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlTypes, requestJson);
            return pack;
        }
        /// <summary>
        /// 获取群控列表
        /// </summary>
        /// <param name="spk"></param>
        /// <returns></returns>
        public ResponsePackNew GetGroupControlList()
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, 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("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            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);
            return pack;
        }
        #endregion
    }
}