You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
647 B
31 lines
647 B
//
|
|
// NetworkManager.h
|
|
// HC
|
|
//
|
|
// Created by huilinLi on 2025/12/15.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
// 定义回调 Block,方便后续使用
|
|
typedef void(^SuccessBlock)(id response);
|
|
typedef void(^FailureBlock)(NSError *error);
|
|
|
|
@interface NetworkManager : NSObject
|
|
|
|
// 单例入口
|
|
+ (instancetype)sharedManager;
|
|
|
|
// 通用 GET 请求
|
|
- (void)GET:(NSString *)url
|
|
params:(NSDictionary *)params
|
|
success:(SuccessBlock)success
|
|
failure:(FailureBlock)failure;
|
|
|
|
// 通用 POST 请求
|
|
- (void)POST:(NSString *)url
|
|
params:(NSDictionary *)params
|
|
success:(SuccessBlock)success
|
|
failure:(FailureBlock)failure;
|
|
|
|
@end
|