Просмотр исходного кода

完成Apex Mobile upload sql 网络请求接口,替换旧接口。

Ray Zhang 6 лет назад
Родитель
Сommit
be0a3424f1

+ 7 - 0
Apex Mobile/Apex Mobile/HomeViewController.m

@@ -323,6 +323,13 @@ typedef enum {
     [self showProgressDialog];
     
     __weak typeof(self) weakSelf = self;
+    
+     NSString *sql = [ApexMobileDB prepareUploadSQLOfUser:appDelegate.user withDiviceID:RAUtils.deviceID];
+    [RANetwork request_uploadsql:sql completionHandler:^(NSMutableDictionary *result) {
+        NSDictionary *json = result;
+    }];
+    
+    return;
     // upload/handle data
     dispatch_async(dispatch_get_global_queue(0, 0), ^{
         

+ 1 - 0
Apex Mobile/Apex Mobile/RANetwork.h

@@ -67,4 +67,5 @@
 +(void) request_changepassword : (NSString*) newpass user:(NSString*) user oldpass:(NSString*) oldpass completionHandler:(resultHandler)result;
 +(void) request_retrievepassword : (NSString*) user  email:(NSString*) email completionHandler:(resultHandler)result;
 + (void)request_sendemail:(NSString *)email CC:(NSString *)cc SerialNo:(NSString *)serialNo completionHandler:(resultHandler)result;
++ (void)request_uploadsql:(NSString *)sql completionHandler:(resultHandler)result;
 @end

+ 25 - 0
Apex Mobile/Apex Mobile/RANetwork.m

@@ -2616,5 +2616,30 @@
 //
 //    return resultDic;
     
+}
+
++ (void)request_uploadsql:(NSString *)sql completionHandler:(resultHandler)result
+{
+    
+    NSMutableDictionary *params = [NSMutableDictionary dictionary];
+    [params setObject:@"handset_search" forKey:@"action"];
+    [params setValue:sql forKey:@"sql"];
+    
+    
+    [self request_interface:URL_UPLOAD_SQL parameters:params err_record_url:nil completionHandler:result retry:0];
+    
+//    NSData* json=[self get_json:URL_UPLOAD_SQL parameters:params  file:nil];
+//
+//    if (json==nil)
+//    {
+//        return @{
+//                 @"result" : @RESULT_NET_ERROR,
+//                 @"err_msg" : MSG_NET_ERROR
+//                 };
+//    }
+//
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:nil];
+//
+//    return resultDic;
 }
 @end