From 9aa32bd5ed75d54b2141b6c91f163d43216a3643 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 06 十二月 2019 13:14:02 +0800 Subject: [PATCH] 20191206 --- HDL_ON/DAL/Server/HttpServerRequest.cs | 196 +++++++++++++++++++++++++++++++++++++------------ 1 files changed, 148 insertions(+), 48 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 30f853f..258ae85 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -1,74 +1,174 @@ -锘縩amespace HDL_ON.DAL.Server +锘縰sing Shared; + +namespace HDL_ON.DAL.Server { public partial class HttpServerRequest { + + /* + * json鏍煎紡 + "{" + + "\"sss\":" + "\"" + sss + "\"" + "," + + "\"xxx\":" + xxx + "," + + "}"; + */ + + #region 娉ㄥ唽銆佺櫥褰曢儴鍒� /// <summary> /// 璐﹀彿鐧诲綍-浣跨敤瀵嗙爜 /// </summary> - public ResponsePack LoginByPassword(string account,string password,int company) + public ResponsePack LoginByPassword(string account, string password) { - var requestObj = new LoginObj() { Account = account, Password = password, Company = company }; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); - var revertObj = RequestHttps(HttpRequesMethods.Login.ToString(), requestJson, ""); - return revertObj; + string jsonString = "{" + + "\"Account\":" + "\"" + account + "\"" + "," + + "\"Password\":" + "\"" + password + "\"" + + "}"; + return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/Login", jsonString, false); } /// <summary> - /// 鎵嬫満鍙风爜娉ㄥ唽寮犲悧 + /// 鎵嬫満鍙风爜娉ㄥ唽 /// </summary> /// <param name="mobileNumber"></param> /// <param name="password"></param> /// <param name="language"></param> public ResponsePack RegisterPhone(string mobileNumber, string password, string language) { - var requestObj = new SignInObj() { Account = mobileNumber, Password = password, Language = language }; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); - return RequestHttps(HttpRequesMethods.SignIn.ToString(), requestJson, ""); + string jsonString = "{" + + "\"Account\":" + "\"" + mobileNumber + "\"" + "," + + "\"Password\":" + "\"" + password + "\"" + "," + + "\"Language\":" + "\"" + language + "\"" + + "}"; + return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/SignIn", jsonString, false); + } + + public ResponsePack GetAreaCode() + { + string requestJson = "{}"; + return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/GetAreaCode", requestJson, false); } /// <summary> - /// 楠岃瘉楠岃瘉鐮� + /// 楠岃瘉鐭俊鎴栬�呴偖绠遍獙璇佺爜锛屼箣鍚庢敞鍐� /// </summary> - public ResponsePack ValidateSmsCode(string mobileNumber, string code) - { - var requestObj = new ValidateSmsCodeObj() { Phone = mobileNumber, Code = code }; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); - return RequestHttps(HttpRequesMethods.ValidateSmsCode.ToString(), requestJson, ""); - } - - /// <summary> - /// 楠岃瘉鎵嬫満鍙锋槸鍚﹀凡缁忚娉ㄥ唽 - /// </summary> - /// <param name="phoneNum">鎵嬫満鍙风爜</param> - public ResponsePack IsExistingAccount(string phoneNum) - { - var requestObj = new IsExistingAccountObj() { Account = phoneNum }; - var requesetJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); - return RequestHttps(HttpRequesMethods.IsExistingAccount.ToString(), requesetJson, ""); - } - /// <summary> - /// 鑾峰彇楠岃瘉鐮� - /// </summary> - /// <param name="phoneNum">鎵嬫満鍙风爜</param> - public ResponsePack GetPhoneVerificationCode(string phoneNum, int company) - { - var requestObj = new SignPhoneObj() { Phone = phoneNum, Company = company }; - var requesetJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); - return RequestHttps(HttpRequesMethods.SignPhone.ToString(), requesetJson, ""); - } - - /// <summary> - /// 楠岃瘉楠岃瘉鐮� - /// </summary> - /// <param name="mobileNumber"></param> - /// <param name="vCode"></param> + /// <param name="account">璐﹀彿</param> + /// <param name="password">瀵嗙爜</param> + /// <param name="entryPassword">纭瀵嗙爜</param> + /// <param name="code">楠岃瘉鐮�</param> + /// <param name="areaCode"></param> /// <returns></returns> - public ResponsePack SendSms(string mobileNumber, string vCode) + public ResponsePack ValidataCodeAndRegister(string account, string password, string entryPassword, string code, int areaCode) { - var requestObj = new ValidateSmsCodeObj() { Phone = mobileNumber, Code = vCode }; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); - return RequestHttps(HttpRequesMethods.ValidateSmsCode.ToString(), requestJson, ""); + //var requestObj = new ValidateSmsCodeObj() { Phone = accout, Code = code }; + //var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + string requestJson = "{" + + "\"Account\":" + "\"" + account + "\"" + "," + + "\"Password\":" + "\"" + password + "\"" + "," + + "\"EnterPassword\":" + "\"" + entryPassword + "\"" + "," + + "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," + + "\"Code\":" + "\"" + code + "\"" + "," + + "\"RegisterSoruce\":" + 0 + "," + + "\"AreaCode\":" + areaCode + + "}"; + return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/ValidataCodeAndRegisterAccount", requestJson, false); } + + /// <summary> + /// 鑾峰彇娉ㄥ唽楠岃瘉鐮� + /// </summary> + public ResponsePack GetPhoneRegisterVerCode(string account) + { + string jsonString = "{" + + "\"Account\":" + "\"" + account + "\"" + "," + + "\"Company\":" + MainPage.Company + "," + + "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," + + "\"AreaCode\":" + UserConfig.Instance.CountryNumber + + "}"; + return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/RegisterSendVerCode", jsonString, false); + + } + + + + /// <summary> + /// 鑾峰彇鐧诲綍楠岃瘉鐮� + /// </summary> + /// <param name="phoneNum">鎵嬫満鍙风爜</param> + public ResponsePack GetPhoneLoginVerCode(string phoneNum) + { + + string jsonString = "{" + + "\"Phone\":" + "\"" + phoneNum + "\"" + "," + + "\"Company\":" + MainPage.Company + + "}"; + return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/LoginSendVerCode", jsonString, false); + } + + /// <summary> + /// 鍙戦�侀獙璇佺爜 + /// </summary> + public ResponsePack SendSms(string account) + { + string jsonString = "{" + + "\"Account\":" + "\"" + account + "\"" + "," + + "\"Company\":" + MainPage.Company + "," + + "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," + + "\"AreaCode\":" + UserConfig.Instance.CountryNumber + + "}"; + return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/LoginSendVerCode", jsonString, false); + } + + /// <summary> + /// 楠岃瘉楠岃瘉鐮� + /// </summary> + /// <param name="account"></param> + /// <param name="code"></param> + /// <returns></returns> + public ResponsePack ValidatorCode(string account, string code, int countryIndex) + { + string jsonString = "{" + + "\"Account\":" + "\"" + account + "\"" + "," + + "\"Code\":" + "\"" + code + "\"" + "," + + "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," + + "\"AreaCode\":" + countryIndex + + "}"; + return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/ValidatorCode", jsonString, false); + } + + /// <summary> + /// 閲嶈瀵嗙爜 + /// </summary> + /// <returns></returns> + public ResponsePack ResetPassword(string account, string password, string rePassword, int countryIndex) + { + string jsonString = "{" + + "\"Account\":" + "\"" + account + "\"" + "," + + "\"Password\":" + "\"" + password + "\"" + "," + + "\"AgainPassword\":" + "\"" + rePassword + "\"" + "," + + "\"AreaCode\":" + countryIndex + + "}"; + return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/ResetPassword", jsonString, false); + } + #endregion + + #region 浣忓畢閮ㄥ垎 + /// <summary> + /// 鑾峰彇浣忓畢鍒楄〃 + /// </summary> + public ResponsePack GetHomePager() + { + string jsonString = "{" + + "\"RequestVersion\":" + "\"" + MainPage.VersionString + "\"" + "," + + "\"RequestSource\":" + "\"" + "1" + "\"" + "," + + "\"HomeType\":" + "\"" + "1" + "\"" + "," + + "\"LoginAccessToken\":" + "\"" + MainPage.LoginUser.LoginTokenString + "\"" + + "}"; + return RequestHttps(@"https://global.hdlcontrol.com/HangZhouHdlCloudApi/App/GetHomePager", jsonString,false); + } + + + + #endregion } } \ No newline at end of file -- Gitblit v1.8.0