|
@@ -1267,6 +1267,9 @@
|
|
|
|
|
|
|
|
+ (NSDictionary *)collectErrMsg:(NSString *)errMsg DeviceInfo:(NSString *)deviceInfo Time:(NSString *)time {
|
|
+ (NSDictionary *)collectErrMsg:(NSString *)errMsg DeviceInfo:(NSString *)deviceInfo Time:(NSString *)time {
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(URL_ERR_LOG.length==0)
|
|
|
|
|
+ return nil;
|
|
|
NSMutableDictionary *params = [@{
|
|
NSMutableDictionary *params = [@{
|
|
|
@"device_info" : deviceInfo == nil ? @"" : deviceInfo,
|
|
@"device_info" : deviceInfo == nil ? @"" : deviceInfo,
|
|
|
@"crash_info" : errMsg == nil ? @"" : errMsg,
|
|
@"crash_info" : errMsg == nil ? @"" : errMsg,
|
|
@@ -1716,12 +1719,8 @@
|
|
|
return [ApexMobileDB getDisplayFieldsForFunction:function withUser:appDelegate.user limit:limit];
|
|
return [ApexMobileDB getDisplayFieldsForFunction:function withUser:appDelegate.user limit:limit];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-#pragma mark new interface
|
|
|
|
|
-
|
|
|
|
|
-+(void)request_marketnews : (NSString*) id limit: (int) limit completionHandler:(resultHandler)result
|
|
|
|
|
|
|
+#pragma mark new_interface
|
|
|
|
|
++(void)request_marketnews : (NSString*) lastid limit: (int) limit completionHandler:(resultHandler)result
|
|
|
{
|
|
{
|
|
|
if(![NetworkUtils IsNetworkAvailable])
|
|
if(![NetworkUtils IsNetworkAvailable])
|
|
|
return ;//RESULT_NET_NOTAVAILABLE;
|
|
return ;//RESULT_NET_NOTAVAILABLE;
|
|
@@ -1729,7 +1728,7 @@
|
|
|
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
[params setValue:@"Market News" forKey:@"module_name"];
|
|
[params setValue:@"Market News" forKey:@"module_name"];
|
|
|
[params setValue:@"search" forKey:@"action_type"];
|
|
[params setValue:@"search" forKey:@"action_type"];
|
|
|
- [params setValue:id forKey:@"id"];
|
|
|
|
|
|
|
+ [params setValue:lastid forKey:@"id"];
|
|
|
[params setValue:[NSString stringWithFormat:@"%d",limit ] forKey:@"limit"];
|
|
[params setValue:[NSString stringWithFormat:@"%d",limit ] forKey:@"limit"];
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1744,5 +1743,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
++(void)request_announcements : (NSString*) lastid limit: (int) limit completionHandler:(resultHandler)result
|
|
|
|
|
+{
|
|
|
|
|
+ if(![NetworkUtils IsNetworkAvailable])
|
|
|
|
|
+ return ;//RESULT_NET_NOTAVAILABLE;
|
|
|
|
|
+ NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
|
|
+ [params setValue:@"Announcements" forKey:@"module_name"];
|
|
|
|
|
+ [params setValue:@"search" forKey:@"action_type"];
|
|
|
|
|
+ [params setValue:lastid forKey:@"id"];
|
|
|
|
|
+ [params setValue:[NSString stringWithFormat:@"%d",limit ] forKey:@"limit"];
|
|
|
|
|
+
|
|
|
|
|
+ [self request_interface:URL_ANNOUNCEMENTS parameters:params err_record_url:nil completionHandler:result retry:0];
|
|
|
|
|
+// NSData* json=[self get_json:URL_ANNOUNCEMENTS parameters:params file:nil];
|
|
|
|
|
+// if (json==nil)
|
|
|
|
|
+// {
|
|
|
|
|
+// DebugLog(@"json is wrong");
|
|
|
|
|
+// return nil;
|
|
|
|
|
+// }
|
|
|
|
|
+// return json;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
++(void) request_servicelocatin:(resultHandler)result
|
|
|
|
|
+{
|
|
|
|
|
+ if(![NetworkUtils IsNetworkAvailable])
|
|
|
|
|
+ return ;//RESULT_NET_NOTAVAILABLE;
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
|
|
+ [params setValue:@"Location" forKey:@"module_name"];
|
|
|
|
|
+ [params setValue:@"search" forKey:@"action_type"];
|
|
|
|
|
+ [params setValue:@"999" forKey:@"limit"];
|
|
|
|
|
+
|
|
|
|
|
+ [self request_interface:URL_LOCATIONS parameters:params err_record_url:nil completionHandler:result retry:0];
|
|
|
|
|
+
|
|
|
|
|
+// NSData* json=[self get_json:URL_LOCATIONS parameters:params file:nil];
|
|
|
|
|
+// if (json==nil)
|
|
|
|
|
+// {
|
|
|
|
|
+// return @{
|
|
|
|
|
+// @"result" : @RESULT_NET_ERROR,
|
|
|
|
|
+// @"err_msg" : MSG_NET_ERROR
|
|
|
|
|
+// };
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// NSError *error=nil;
|
|
|
|
|
+// NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// NSString* path = [[RAUtils appCacheDirectory] stringByAppendingPathComponent:@"service_location.json"];
|
|
|
|
|
+// if(jsobj!=nil&&[jsobj[@"result"] intValue]!=RESULT_NET_ERROR&&[jsobj[@"result"] intValue]!=RESULT_NET_NOTAVAILABLE)
|
|
|
|
|
+// {
|
|
|
|
|
+//
|
|
|
|
|
+// [jsobj writeToFile:path atomically:YES];
|
|
|
|
|
+//// return ret;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// return jsobj;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
++(void)request_login : (NSString*) user password:(NSString*) password completionHandler:(resultHandler)result
|
|
|
|
|
+{
|
|
|
|
|
+
|
|
|
|
|
+ if(![NetworkUtils IsNetworkAvailable])
|
|
|
|
|
+ return ;
|
|
|
|
|
+ // if(![RANetwork IsHostAvailable:URL_UPDATE_AUTH])
|
|
|
|
|
+ // return RESULT_NET_ERROR;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ __block long ver = 0;
|
|
|
|
|
+ NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
|
|
+
|
|
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
+ ver = appDelegate.authVer;
|
|
|
|
|
+ if(appDelegate.duid !=nil)
|
|
|
|
|
+ [params setValue:appDelegate.duid forKey:@"udid"];
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ [params setValue:@"handset_login" forKey:@"action"];
|
|
|
|
|
+ // [headers setValue:[NSString stringWithFormat:@"%d",dataLength] forKey:@"Content-Length"];
|
|
|
|
|
+
|
|
|
|
|
+ [params setValue:user forKey:@"user"];
|
|
|
|
|
+ [params setValue:password forKey:@"password"];
|
|
|
|
|
+ [params setValue:[NSString stringWithFormat:@"%ld",ver] forKey:@"auth_ver"];
|
|
|
|
|
+#ifdef TEST
|
|
|
|
|
+ [params setValue:@"true" forKey:@"is_debug"];
|
|
|
|
|
+#else
|
|
|
|
|
+ [params setValue:@"false" forKey:@"is_debug"];
|
|
|
|
|
+#endif
|
|
|
|
|
+ NSData* json=[self get_json:URL_UPDATE_AUTH parameters:params file:nil];
|
|
|
|
|
+ if(json==nil)
|
|
|
|
|
+ return ;
|
|
|
|
|
+
|
|
|
|
|
+ int ret = [self parse_authinfo:json user:user password:password];
|
|
|
|
|
+ DebugLog(@"parse_authinfo return %d ",ret);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return ;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
@end
|
|
@end
|