From 3698c13aba988cd3e41b91b255e1c682c057e565 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期四, 23 三月 2023 11:49:58 +0800
Subject: [PATCH] 1.新增历史记录相关页面及功能 2.修改配网为热点配网 3.设备列表增加过滤门锁功能 4.增加添加设备通知功能

---
 EZSDK/EZSDK/EZ/Global/EZHttpUtil.m |   48 +++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m b/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m
index 2d5042c..3fc0474 100644
--- a/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m
+++ b/EZSDK/EZSDK/EZ/Global/EZHttpUtil.m
@@ -24,6 +24,7 @@
 #define API_POST_EZ_TempList @"/home-wisdom/platform/yingshi/lock/temp/list"//钀ょ煶闂ㄤ复鏃跺瘑鐮佸垪琛�
 #define API_POST_EZ_AddTemp @"/home-wisdom/platform/yingshi/lock/temp/add"//钀ょ煶闂ㄦ坊鍔犱复鏃跺瘑鐮�
 #define API_POST_EZ_DeleteTemp @"/home-wisdom/platform/yingshi/lock/temp/delete"//钀ょ煶闂ㄥ垹闄や复鏃跺瘑鐮�
+#define API_POST_EZ_DeviceMessage @"/home-wisdom/app/device/message"//钀ょ煶璁惧娑堟伅鍒楄〃
 
 #define API_POST_EZ_GetAlarmList @"/home-wisdom/platform/yingshi/alarm/records"//鑾峰彇鎶ヨ娑堟伅
 #define API_POST_EZ_DeleteAlarmMes @"/home-wisdom/platform/yingshi/alarm/delete"//鍒犻櫎鎶ヨ娑堟伅
@@ -116,7 +117,7 @@
                               verifyCode:(NSString *)verifyCode
                               completion:(void (^)(ResponseData *responseData))completion{
 
-    //2.璁剧疆璇锋眰鍙傛暟
+    //璁剧疆璇锋眰鍙傛暟
     NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
     [parameters setValue:deviceSerial forKey:@"deviceSerial"];
     [parameters setValue:verifyCode forKey:@"validateCode"];
@@ -125,7 +126,16 @@
     
     parameters = [self GetSignRequestDictionary:parameters];
     
+    HDLEZLog(@"娣诲姞璁惧鍙傛暟锛�%@",parameters);
+
+    
     [self requestHttpsPost:API_POST_EZ_AddDevice parameters:parameters completion:^(ResponseData *responseData) {
+        if (responseData.success){//娣诲姞鎴愬姛锛岃Е鍙戜唬鐞�
+            if ([EZSDK sharedInstance].delegate&&[[EZSDK sharedInstance].delegate respondsToSelector:@selector(addDeviceSuccessed)]) {
+                [[EZSDK sharedInstance].delegate addDeviceSuccessed];
+            }
+        }
+        
         if (completion) {
             completion (responseData);
         }
@@ -229,20 +239,17 @@
  *  @since 娌充笢闂ㄩ攣缁堢鎺堟潈鎺ュ彛
  *  @param password   闂ㄩ攣瀵嗙爜
  *  @param deviceId   璁惧id
- *  @param verifyCode   sdk鑾峰彇鐨勬牎楠岀爜
  *  @param completion   鍥炶皟block锛宔rror涓虹┖鏃惰〃绀烘坊鍔犳垚鍔�
  *
  */
 - (void)authLockByHDL:(NSString *)password
                deviceId:(NSString *)deviceId
-           verifyCode:(NSString *)verifyCode
            completion:(void (^)(ResponseData *responseData))completion{
     //2.璁剧疆璇锋眰鍙傛暟
     NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
     [parameters setValue:deviceId forKey:@"deviceId"];
     [parameters setValue:[NSString stringWithFormat:@"%@",[GlobalKit shareKit].hdlAppKey] forKey:@"appKey"];
     [parameters setValue:password forKey:@"password"];
-    [parameters setValue:verifyCode forKey:@"verifyCode"];
     [parameters setValue:[GlobalKit shareKit].hdlHomeId forKey:@"homeId"];
     
     parameters = [self GetSignRequestDictionary:parameters];
@@ -294,7 +301,7 @@
  */
 - (void)getTempListByHDL:(NSString *)deviceId
               completion:(void (^)(ResponseData *responseData))completion{
-    //2.璁剧疆璇锋眰鍙傛暟
+    //璁剧疆璇锋眰鍙傛暟
     NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
     [parameters setValue:deviceId forKey:@"deviceId"];
     [parameters setValue:[NSString stringWithFormat:@"%@",[GlobalKit shareKit].hdlAppKey] forKey:@"appKey"];
@@ -367,6 +374,37 @@
 
 }
 
+/**
+ *  @since 娌充笢鑾峰彇璁惧娑堟伅
+ *  @param deviceId   璁惧id
+ *  @param pageSize   椤甸潰澶у皬
+ *  @param pageNo   褰撳墠椤�
+ *  @param completion   鍥炶皟block锛宔rror涓虹┖鏃惰〃绀烘垚鍔�
+ *
+ */
+- (void)getDeviceMessageByHDL:(NSString *)deviceId
+                     pageSize:(NSInteger)pageSize
+                       pageNo:(NSInteger)pageNo
+                   completion:(void (^)(ResponseData *responseData))completion{
+    //璁剧疆璇锋眰鍙傛暟
+    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
+    [parameters setValue:deviceId forKey:@"deviceId"];
+    [parameters setValue:[NSString stringWithFormat:@"%ld",(long)pageSize] forKey:@"pageSize"];
+    [parameters setValue:[NSString stringWithFormat:@"%ld",(long)pageNo] forKey:@"pageNo"];
+    [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_DeviceMessage parameters:parameters completion:^(ResponseData *responseData) {
+        if (completion) {
+            completion (responseData);
+        }
+    }];
+}
+
 /// 鍒锋柊token
 /// @param block 缁撴灉
 - (void)refreshHDLToken:(void (^)(BOOL isSuccess))block{

--
Gitblit v1.8.0