Commit cd7b1f3a authored by 汪洋's avatar 汪洋

list_update_1

parent 65432171
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
D32ECC431D33840600AEF0D0 /* GMDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = D32ECC421D33840600AEF0D0 /* GMDetailController.m */; }; D32ECC431D33840600AEF0D0 /* GMDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = D32ECC421D33840600AEF0D0 /* GMDetailController.m */; };
D32ECC451D33943500AEF0D0 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D32ECC441D33943500AEF0D0 /* Launch Screen.storyboard */; }; D32ECC451D33943500AEF0D0 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D32ECC441D33943500AEF0D0 /* Launch Screen.storyboard */; };
D32ECC481D33946600AEF0D0 /* GMListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D32ECC471D33946600AEF0D0 /* GMListViewController.m */; }; D32ECC481D33946600AEF0D0 /* GMListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D32ECC471D33946600AEF0D0 /* GMListViewController.m */; };
D3AC686421075A290083DAAF /* GMSwiftTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3AC686321075A290083DAAF /* GMSwiftTest.swift */; };
D3EB0CC41D33968300EEDD8B /* GMListViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D3EB0CC31D33968300EEDD8B /* GMListViewModel.m */; }; D3EB0CC41D33968300EEDD8B /* GMListViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D3EB0CC31D33968300EEDD8B /* GMListViewModel.m */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -73,6 +74,7 @@ ...@@ -73,6 +74,7 @@
D32ECC441D33943500AEF0D0 /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; }; D32ECC441D33943500AEF0D0 /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
D32ECC461D33946600AEF0D0 /* GMListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GMListViewController.h; sourceTree = "<group>"; }; D32ECC461D33946600AEF0D0 /* GMListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GMListViewController.h; sourceTree = "<group>"; };
D32ECC471D33946600AEF0D0 /* GMListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GMListViewController.m; sourceTree = "<group>"; }; D32ECC471D33946600AEF0D0 /* GMListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GMListViewController.m; sourceTree = "<group>"; };
D3AC686321075A290083DAAF /* GMSwiftTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GMSwiftTest.swift; sourceTree = "<group>"; };
D3EB0CC21D33968300EEDD8B /* GMListViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GMListViewModel.h; sourceTree = "<group>"; }; D3EB0CC21D33968300EEDD8B /* GMListViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GMListViewModel.h; sourceTree = "<group>"; };
D3EB0CC31D33968300EEDD8B /* GMListViewModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GMListViewModel.m; sourceTree = "<group>"; }; D3EB0CC31D33968300EEDD8B /* GMListViewModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GMListViewModel.m; sourceTree = "<group>"; };
E10ABE29C983D16788B32755 /* Pods-GMBase_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GMBase_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-GMBase_Tests/Pods-GMBase_Tests.debug.xcconfig"; sourceTree = "<group>"; }; E10ABE29C983D16788B32755 /* Pods-GMBase_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GMBase_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-GMBase_Tests/Pods-GMBase_Tests.debug.xcconfig"; sourceTree = "<group>"; };
...@@ -153,6 +155,7 @@ ...@@ -153,6 +155,7 @@
D3EB0CC31D33968300EEDD8B /* GMListViewModel.m */, D3EB0CC31D33968300EEDD8B /* GMListViewModel.m */,
D32ECC411D33840600AEF0D0 /* GMDetailController.h */, D32ECC411D33840600AEF0D0 /* GMDetailController.h */,
D32ECC421D33840600AEF0D0 /* GMDetailController.m */, D32ECC421D33840600AEF0D0 /* GMDetailController.m */,
D3AC686321075A290083DAAF /* GMSwiftTest.swift */,
6003F5A8195388D20070C39A /* Images.xcassets */, 6003F5A8195388D20070C39A /* Images.xcassets */,
6003F594195388D20070C39A /* Supporting Files */, 6003F594195388D20070C39A /* Supporting Files */,
D30F80EB1D2F5C9E00DA1E3C /* GMBase_Example-Bridging-Header.h */, D30F80EB1D2F5C9E00DA1E3C /* GMBase_Example-Bridging-Header.h */,
...@@ -319,13 +322,13 @@ ...@@ -319,13 +322,13 @@
); );
inputPaths = ( inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-GMBase_Example/Pods-GMBase_Example-frameworks.sh", "${SRCROOT}/Pods/Target Support Files/Pods-GMBase_Example/Pods-GMBase_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/GMBase/GMBase.framework", "${BUILT_PRODUCTS_DIR}/GMBase/GMBase.framework",
"${BUILT_PRODUCTS_DIR}/GMCache/GMCache.framework", "${BUILT_PRODUCTS_DIR}/GMCache/GMCache.framework",
"${BUILT_PRODUCTS_DIR}/GMHud/GMHud.framework", "${BUILT_PRODUCTS_DIR}/GMHud/GMHud.framework",
"${BUILT_PRODUCTS_DIR}/GMJSONModel/GMJSONModel.framework", "${BUILT_PRODUCTS_DIR}/GMJSONModel/GMJSONModel.framework",
"${BUILT_PRODUCTS_DIR}/GMKit/GMKit.framework", "${BUILT_PRODUCTS_DIR}/GMKit/GMKit.framework",
"${BUILT_PRODUCTS_DIR}/GMNetService/GMNetService.framework", "${BUILT_PRODUCTS_DIR}/GMNetworking/GMNetworking.framework",
"${BUILT_PRODUCTS_DIR}/GMPhobos/GMPhobos.framework", "${BUILT_PRODUCTS_DIR}/GMPhobos/GMPhobos.framework",
"${BUILT_PRODUCTS_DIR}/GMRefresh/GMRefresh.framework", "${BUILT_PRODUCTS_DIR}/GMRefresh/GMRefresh.framework",
"${BUILT_PRODUCTS_DIR}/MBProgressHUD/MBProgressHUD.framework", "${BUILT_PRODUCTS_DIR}/MBProgressHUD/MBProgressHUD.framework",
...@@ -336,13 +339,13 @@ ...@@ -336,13 +339,13 @@
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMBase.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMBase.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMCache.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMCache.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMHud.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMHud.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMJSONModel.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMJSONModel.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMNetService.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMNetworking.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMPhobos.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMPhobos.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMRefresh.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMRefresh.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MBProgressHUD.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MBProgressHUD.framework",
...@@ -404,6 +407,7 @@ ...@@ -404,6 +407,7 @@
6003F5A7195388D20070C39A /* GMViewController.m in Sources */, 6003F5A7195388D20070C39A /* GMViewController.m in Sources */,
D32ECC431D33840600AEF0D0 /* GMDetailController.m in Sources */, D32ECC431D33840600AEF0D0 /* GMDetailController.m in Sources */,
D3EB0CC41D33968300EEDD8B /* GMListViewModel.m in Sources */, D3EB0CC41D33968300EEDD8B /* GMListViewModel.m in Sources */,
D3AC686421075A290083DAAF /* GMSwiftTest.swift in Sources */,
6003F59A195388D20070C39A /* main.m in Sources */, 6003F59A195388D20070C39A /* main.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -482,6 +486,7 @@ ...@@ -482,6 +486,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.3; IPHONEOS_DEPLOYMENT_TARGET = 8.3;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
...@@ -514,6 +519,7 @@ ...@@ -514,6 +519,7 @@
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.3; IPHONEOS_DEPLOYMENT_TARGET = 8.3;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
...@@ -564,6 +570,7 @@ ...@@ -564,6 +570,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = E10ABE29C983D16788B32755 /* Pods-GMBase_Tests.debug.xcconfig */; baseConfigurationReference = E10ABE29C983D16788B32755 /* Pods-GMBase_Tests.debug.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks", "$(SDKROOT)/Developer/Library/Frameworks",
...@@ -588,6 +595,7 @@ ...@@ -588,6 +595,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 78552CB3DCC72D38AB9DD053 /* Pods-GMBase_Tests.release.xcconfig */; baseConfigurationReference = 78552CB3DCC72D38AB9DD053 /* Pods-GMBase_Tests.release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks", "$(SDKROOT)/Developer/Library/Frameworks",
......
...@@ -7,17 +7,11 @@ ...@@ -7,17 +7,11 @@
// //
#import "GMAppDelegate.h" #import "GMAppDelegate.h"
#import <GMNetService/WMNetService.h>
@implementation GMAppDelegate @implementation GMAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{ {
// Override point for customization after application launch.
WMNetService *service = [WMNetService sharedInstance];
service.apiHost = @"http://backend.gmei.com";
service.webHost = @"http://m.gmei.com";
service.urlCommonParameters = @"";
return YES; return YES;
} }
......
//
// GMSwiftTest.swift
// GMBase_Example
//
// Created by wangyang on 2018/7/24.
// Copyright © 2018年 wangyang. All rights reserved.
//
import Foundation
...@@ -20,7 +20,7 @@ end ...@@ -20,7 +20,7 @@ end
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
target.build_configurations.each do |config| target.build_configurations.each do |config|
# config.build_settings['SWIFT_SWIFT3_OBJC_INFERENCE'] = 'Default'
end end
end end
end end
......
PODS: PODS:
- AFNetworking (3.1.0): - Alamofire (4.6.0)
- AFNetworking/NSURLSession (= 3.1.0) - GMBase (0.4.3):
- AFNetworking/Reachability (= 3.1.0)
- AFNetworking/Security (= 3.1.0)
- AFNetworking/Serialization (= 3.1.0)
- AFNetworking/UIKit (= 3.1.0)
- AFNetworking/NSURLSession (3.1.0):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (3.1.0)
- AFNetworking/Security (3.1.0)
- AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- GMBase (0.4.2):
- GMHud - GMHud
- GMJSONModel - GMJSONModel
- GMKit - GMKit
- GMNetService - GMNetworking
- GMPhobos - GMPhobos
- GMRefresh - GMRefresh
- MBProgressHUD - MBProgressHUD
...@@ -62,8 +48,8 @@ PODS: ...@@ -62,8 +48,8 @@ PODS:
- GMKit/Protocol (0.8.8): - GMKit/Protocol (0.8.8):
- Masonry (= 1.1.0) - Masonry (= 1.1.0)
- SDWebImage (= 3.7.6) - SDWebImage (= 3.7.6)
- GMNetService (0.1.91): - GMNetworking (3.2.1):
- AFNetworking (= 3.1.0) - Alamofire (= 4.6.0)
- GMPhobos (0.5.5): - GMPhobos (0.5.5):
- GMCache (= 0.2.0) - GMCache (= 0.2.0)
- GMKit - GMKit
...@@ -86,11 +72,11 @@ SPEC REPOS: ...@@ -86,11 +72,11 @@ SPEC REPOS:
- GMHud - GMHud
- GMJSONModel - GMJSONModel
- GMKit - GMKit
- GMNetService - GMNetworking
- GMPhobos - GMPhobos
- GMRefresh - GMRefresh
https://github.com/cocoapods/specs.git: https://github.com/cocoapods/specs.git:
- AFNetworking - Alamofire
- Masonry - Masonry
- MBProgressHUD - MBProgressHUD
- SDWebImage - SDWebImage
...@@ -102,13 +88,13 @@ EXTERNAL SOURCES: ...@@ -102,13 +88,13 @@ EXTERNAL SOURCES:
:path: "../" :path: "../"
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 Alamofire: f41a599bd63041760b26d393ec1069d9d7b917f4
GMBase: 888de394aa486c72a5eb50a12ff4fb0fa717403b GMBase: a21b554f8884c885bf029d913d814972792631da
GMCache: b7d48432ee2469eb0c6c86c720a1958bd373187e GMCache: b7d48432ee2469eb0c6c86c720a1958bd373187e
GMHud: 9cc3942fc9f215db55b134cbfd05a458b124a964 GMHud: 9cc3942fc9f215db55b134cbfd05a458b124a964
GMJSONModel: 5e81a98de668e9f93cf6ff77869f77b0d1a806be GMJSONModel: 5e81a98de668e9f93cf6ff77869f77b0d1a806be
GMKit: c391d788905c730445781095c5a2113a6bbf0d06 GMKit: c391d788905c730445781095c5a2113a6bbf0d06
GMNetService: 28753d087267511bebb3ec9944baa917bcc1a64d GMNetworking: 0378ffe13d74c2e096be1a0e560d90b0548d9baf
GMPhobos: d3741744a77fb40df027cc846b14e5687b931e00 GMPhobos: d3741744a77fb40df027cc846b14e5687b931e00
GMRefresh: 021ccae1b905e05c0c82e9c0180f617f593d227c GMRefresh: 021ccae1b905e05c0c82e9c0180f617f593d227c
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
...@@ -117,6 +103,6 @@ SPEC CHECKSUMS: ...@@ -117,6 +103,6 @@ SPEC CHECKSUMS:
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
"UITableView+FDTemplateLayoutCell": 234e1582bcc4e18461af91155123bb96538ed030 "UITableView+FDTemplateLayoutCell": 234e1582bcc4e18461af91155123bb96538ed030
PODFILE CHECKSUM: b9c24bb8fb1ea50b58c59e079b456b4ca1d9b998 PODFILE CHECKSUM: eea9ea5d0cf6a782cc902795788fe1e627c5bf03
COCOAPODS: 1.5.3 COCOAPODS: 1.5.3
...@@ -12,7 +12,7 @@ Pod::Spec.new do |s| ...@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
s.dependency 'GMRefresh' s.dependency 'GMRefresh'
s.dependency 'GMJSONModel' s.dependency 'GMJSONModel'
s.dependency 'UITableView+FDTemplateLayoutCell', '1.4' s.dependency 'UITableView+FDTemplateLayoutCell', '1.4'
s.dependency 'GMNetService' s.dependency 'GMNetworking'
s.dependency 'MBProgressHUD' s.dependency 'MBProgressHUD'
s.dependency 'GMPhobos' s.dependency 'GMPhobos'
s.dependency 'GMHud' s.dependency 'GMHud'
......
...@@ -64,8 +64,6 @@ ...@@ -64,8 +64,6 @@
} else { } else {
make.top.mas_equalTo(0); make.top.mas_equalTo(0);
} }
// make.top.mas_equalTo(OCNavigationBar.barHeight);
make.bottom.mas_equalTo(0); make.bottom.mas_equalTo(0);
}]; }];
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import "WMViewModel.h" #import "WMViewModel.h"
#import <GMNetService/WMNetService.h>
/** /**
* @brief WMTableView协议 * @brief WMTableView协议
...@@ -81,7 +81,6 @@ ...@@ -81,7 +81,6 @@
*/ */
NSString *_deduplicationKey; NSString *_deduplicationKey;
} }
@property (nonatomic,assign) HttpMethod httpMethod;
@property (nonatomic, copy) NSArray *notDeduplicate; @property (nonatomic, copy) NSArray *notDeduplicate;
// 去重时被去掉的数据总计。在上拉加载更多时,这个数目仍要被用上,否则在某种极端的情况下,startNum会与服务器对不上,导致出现没有数据返回 // 去重时被去掉的数据总计。在上拉加载更多时,这个数目仍要被用上,否则在某种极端的情况下,startNum会与服务器对不上,导致出现没有数据返回
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
#import "WMFetchDataViewModel.h" #import "WMFetchDataViewModel.h"
@import GMNetworking;
@implementation WMFetchDataViewModel @implementation WMFetchDataViewModel
{ {
...@@ -24,8 +25,7 @@ ...@@ -24,8 +25,7 @@
_fetchDataErrorMsg = @"获取数据失败,请重试"; _fetchDataErrorMsg = @"获取数据失败,请重试";
_fetchDataNilMsg = @"暂时没有相关数据"; _fetchDataNilMsg = @"暂时没有相关数据";
_message = @""; _message = @"";
//方便 某个接口做其他请求方式 上传需求
_httpMethod = HttpMethodGet;
} }
return self; return self;
} }
...@@ -49,45 +49,42 @@ ...@@ -49,45 +49,42 @@
return; return;
} }
if (_httpMethod == nil) {
//防止某种情况下为空 加一个默认值
_httpMethod = HttpMethodGet;
}
[self buildParams]; [self buildParams];
[[WMNetService sharedInstance] sendRequestWithURLString:_remoteUrl parameters:_params method:_httpMethod success:^(id responseObject) { // [GMNetworking ];
if ([self shouldClearDataForResponse:responseObject]) { // [[WMNetService sharedInstance] sendRequestWithURLString:_remoteUrl parameters:_params method:_httpMethod success:^(id responseObject) {
[self clearData]; // if ([self shouldClearDataForResponse:responseObject]) {
} // [self clearData];
// }
//某些接口返回的直接是数组 //
if ([responseObject isKindOfClass:[NSArray class]]) { // //某些接口返回的直接是数组
// if ([responseObject isKindOfClass:[NSArray class]]) {
NSArray *array = (NSArray *)responseObject; //
[self buildModelWithRemoteArray:array]; // NSArray *array = (NSArray *)responseObject;
[self setValue:@YES forKey:@"fetchDataSuccess"]; // [self buildModelWithRemoteArray:array];
// [self setValue:@YES forKey:@"fetchDataSuccess"];
}else if([responseObject isKindOfClass:[NSDictionary class]]){ //
// }else if([responseObject isKindOfClass:[NSDictionary class]]){
NSDictionary *dic = (NSDictionary *)responseObject; //
NSInteger code = [[dic objectForKey:@"error"] integerValue]; // NSDictionary *dic = (NSDictionary *)responseObject;
self.message = responseObject[@"message"]; // NSInteger code = [[dic objectForKey:@"error"] integerValue];
if (code == APIStatusCodeSuccess) { // self.message = responseObject[@"message"];
[self buildModelWithRemoteDic:dic]; // if (code == APIStatusCodeSuccess) {
[self setValue:@YES forKey:@"fetchDataSuccess"]; // [self buildModelWithRemoteDic:dic];
// [self setValue:@YES forKey:@"fetchDataSuccess"];
}else if (code == APIStatusCodeEmpty){ //
self.message = responseObject[@"message"]; // }else if (code == APIStatusCodeEmpty){
[self setValue:@YES forKey:@"fetchDataSuccess"]; // self.message = responseObject[@"message"];
// [self setValue:@YES forKey:@"fetchDataSuccess"];
}else{ //
[self setValue:@NO forKey:@"fetchDataSuccess"]; // }else{
} // [self setValue:@NO forKey:@"fetchDataSuccess"];
} // }
// }
} failed:^(NSString *errorMsg) { //
[self setValue:@NO forKey:@"fetchDataSuccess"]; // } failed:^(NSString *errorMsg) {
}]; // [self setValue:@NO forKey:@"fetchDataSuccess"];
// }];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment