From 4c1abca185a5727da6fb314a0cb4cd44bfe1b3bf Mon Sep 17 00:00:00 2001 From: Davin <591807572@qq.com> Date: 星期五, 07 六月 2024 17:48:47 +0800 Subject: [PATCH] feature appkey修改 --- EZSDK/EZSDK/EZ/Global/EZHttpUtil.m | 61 +++++++++++++++++++++++++++++- 1 files changed, 59 insertions(+), 2 deletions(-) diff --git a/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m b/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m index f0aadb2..94b201a 100644 --- a/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m +++ b/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m @@ -33,10 +33,12 @@ #define API_POST_EZ_GetCoverSwitchStaus @"/home-wisdom/platform/yingshi/getCoverSwitchStatus"//鑾峰彇钀ょ煶闀滃ご閬斀寮�鍏崇姸鎬� #define API_POST_EZ_GetCoverSwitch @"/home-wisdom/platform/yingshi/coverSwitch"//璁剧疆钀ょ煶闀滃ご閬斀寮�鍏� #define AOI_POST_EZ_UpdateAnswerStatus @"/home-wisdom/platform/yingshi/lock/updateAnswerStatus" // 鏇存敼闂ㄩ搩閫氳瘽鐘舵��(鎺ュ惉鍜屾湭鎺�) +#define API_POST_EZ_GetAiSupportList @"/home-wisdom/platform/yingshi/getAiSupportList"//鑾峰彇鎽勫儚澶存櫤鑳界畻娉曞垪琛ㄥ拰鐘舵�� +#define API_POST_EZ_SetAiSupport @"/home-wisdom/platform/yingshi/setAiSupport"//璁剧疆鎽勫儚澶存櫤鑳界畻娉� #pragma mark APP_KEY -#define APP_KEY @"HDL-HOME-APP-TEST" -#define SECRET_KEY @"WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss" +#define APP_KEY @"QWERREWQ" +#define SECRET_KEY @"CPBUCTRLCPBUABCD" #define TIME_OUT 30.0f @@ -501,6 +503,60 @@ }]; } +/** + * @since 鑾峰彇鎽勫儚澶存櫤鑳界畻娉曞垪琛ㄥ拰鐘舵�� + * @param deviceSerial 璁惧搴忓垪鍙� + * @param completion 鍥炶皟block锛宔rror涓虹┖鏃惰〃绀烘垚鍔� + */ +- (void)getAiSupportDetectionList:(NSString *)deviceSerial + completion:(void (^)(ResponseData *responseData))completion { + //璁剧疆璇锋眰鍙傛暟 + NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; + [parameters setValue:deviceSerial forKey:@"deviceSerial"]; +// [parameters setValue:@(1) forKey:@"platform"]; +// [parameters setValue:[NSString stringWithFormat:@"%@",[GlobalKit shareKit].hdlAppKey] forKey:@"appKey"]; +// [parameters setValue:[GlobalKit shareKit].hdlHomeId forKey:@"homeId"]; + + parameters = [self GetSignRequestDictionary:parameters]; + + NSLog(@"鑾峰彇璁惧娑堟伅鍙傛暟锛�%@",parameters); + + [self requestHttpsPost:API_POST_EZ_GetAiSupportList parameters:parameters completion:^(ResponseData *responseData) { + if (completion) { + completion (responseData); + } + }]; +} + +/** + * @since 璁剧疆鎽勫儚澶存櫤鑳界畻娉� + * @param deviceSerial 璁惧搴忓垪鍙� + * @param code 鏅鸿兘绠楁硶缂栫爜 + * @param completion 鍥炶皟block锛宔rror涓虹┖鏃惰〃绀烘垚鍔� + */ +- (void)setAiSupportDetection:(NSString *)deviceSerial + code:(NSString *)code + completion:(void (^)(ResponseData *responseData))completion { + //璁剧疆璇锋眰鍙傛暟 + NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; + [parameters setValue:deviceSerial forKey:@"deviceSerial"]; + [parameters setValue:code forKey:@"code"]; +// [parameters setValue:@(1) forKey:@"platform"]; +// [parameters setValue:[NSString stringWithFormat:@"%@",[GlobalKit shareKit].hdlAppKey] forKey:@"appKey"]; +// [parameters setValue:[GlobalKit shareKit].hdlHomeId forKey:@"homeId"]; + + parameters = [self GetSignRequestDictionary:parameters]; + + NSLog(@"鑾峰彇璁惧娑堟伅鍙傛暟锛�%@",parameters); + + [self requestHttpsPost:API_POST_EZ_SetAiSupport parameters:parameters completion:^(ResponseData *responseData) { + if (completion) { + completion (responseData); + } + }]; +} + + /// 鍒锋柊token /// @param block 缁撴灉 - (void)refreshHDLToken:(void (^)(BOOL isSuccess))block{ @@ -629,6 +685,7 @@ UInt64 recordTime = [[NSDate date] timeIntervalSince1970]*1000; [params setValue:APP_KEY forKey:@"appKey"]; [params setValue:[NSString stringWithFormat:@"%llu",recordTime] forKey:@"timestamp"]; + NSLog(@"##########APPKEY:%@, SECRET_KEY:%@", APP_KEY, SECRET_KEY); //1.瀵筀EY鍗囧簭 NSArray *keyArray = [params allKeys]; NSArray *sortKeyArray = [keyArray sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) { -- Gitblit v1.8.0