// // DataCenter.h // FirstLink // // Created by unicode on 14-9-15. // Copyright (c) 2014年 FirstLink. All rights reserved. // #import #import "FLLocalStorage.h" #import @protocol FLNetworkDelegate @optional - (void)networkNotReachable; - (void)networkDidReceiveError:(NSError*)error identify:(int)identify header:(MSGHeader*)header; - (void)networkDidSuccessResponse:(NSDictionary*)response identify:(int)identify header:(MSGHeader*)header; - (void)networkDidSuccessResponse:(NSDictionary*)response identify:(int)identify header:(MSGHeader*)header userInfo:(NSDictionary *)userInfo; @end @interface FLDataCenter : NSObject +(FLDataCenter*)sharedDataCenter; #pragma mark - Network Block API - (void)POST:(NSString *)URLString parameters:(NSDictionary *)parameters success:(void (^)(MSGHeader *header, id responseObject))success failure:(void (^)(MSGHeader *header, NSError *error))failure; - (void)POSTData:(NSData*)data name:(NSString*)name fileName:(NSString*)fileName mimeType:(NSString*)miniType url:(NSURL*)url parameters:(NSDictionary *)parameters success:(void (^)(MSGHeader *header, id responseObject))success progress:(void (^)(NSUInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite))progress failure:(void (^)(MSGHeader *header, NSError *error))failure; #pragma mark - Network Delegate API - (void)POST:(NSString *)url para:(NSDictionary *)para identify:(int)identify delegate:(id)delegate; - (void)POST:(NSString *)url para:(NSDictionary *)para identify:(int)identify delegate:(id)delegate userInfo:(NSDictionary *)userInfo; #pragma mark - Local DataBase API + (FMDatabase *)defaultDatabase; @end