12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // SPSBNetworkManager.h
- // 我的社保
- //
- // Created by shanp on 2021/4/20.
- //
- #import <UIKit/UIKit.h>
- typedef NS_ENUM(NSInteger, SPSBNetworkErrorCode) {
- SPSBNetworkErrorCodeSuccess = 200,
- SPSBNetworkErrorCodeConnectErrorMessage,
- SPSBNetworkErrorCodeConnectError,
- SPSBNetworkErrorCodeNetwrokMiss,
- };
- typedef NS_ENUM(NSInteger, SPSBNetworkMethod) {
- SPSBNetworkMethodGET,
- SPSBNetworkMethodPOST,
- SPSBNetworkMethodPUT,
- SPSBNetworkMethodDELETE
- };
- NS_ASSUME_NONNULL_BEGIN
- UIKIT_EXTERN const NSInteger SPSBNetworkCallbackSuccessCode;
- UIKIT_EXTERN const NSInteger SPSBNetworkCallbackNeedLogin;
- UIKIT_EXTERN const NSInteger SPSBNetworkCallbackKeyInvalid;
- typedef void(^SPSBNetworkManagerCallbackBlock)(NSError *error, id _Nullable data);
- @interface SPSBNetworkManager : NSObject
- - (void)networkUseMethod:(SPSBNetworkMethod)method isLogin:(bool)isLogin url:(NSString *)url urlParameters:(nullable NSDictionary *)urlParameters parameters:(nullable NSDictionary *)parameters completion:(SPSBNetworkManagerCallbackBlock)completion;
- - (void)networkUseMethod:(SPSBNetworkMethod)method isLogin:(bool)isLogin url:(NSString *)url filtrationKey:(NSString *)filtrationKey urlParameters:(nullable NSDictionary *)urlParameters parameters:(nullable NSDictionary *)parameters completion:(SPSBNetworkManagerCallbackBlock)completion;
- - (void)cancelUrl:(NSString *)url filtrationKey:(NSString *)filtrationKey;
- - (void)cancelAll;
- - (void)networkDownloadImageWithUrl:(NSString *)url key:(NSString *)key completion:(SPSBNetworkManagerCallbackBlock)completion;
- - (void)networkPostImageWihtUrl:(NSString *)url parameters:(nullable NSDictionary *)parameters imageArray:(NSArray<UIImage *> *)imageArray completion:(SPSBNetworkManagerCallbackBlock)completion;
- @end
- NS_ASSUME_NONNULL_END
|