-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGHNetworkConstant.h
More file actions
60 lines (47 loc) · 1.8 KB
/
GHNetworkConstant.h
File metadata and controls
60 lines (47 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// GHNetworkConstant.h
// GHNetworkModule
//
// Created by Qincc on 2020/12/12.
//
#ifndef GHNetworkConstant_h
#define GHNetworkConstant_h
#import "GHRequestInterceptorProtocol.h"
#import "GHResponseInterceptorProtocol.h"
@class GHNetworkResponse,GHNetworkRequest,GHNetworkGroupRequest/*GHNetworkChainRequest*/;
typedef NS_ENUM (NSUInteger, GHNetworkRequestMethod){
GHNetworkRequestMethodGET = 0,
GHNetworkRequestMethodPOST,
GHNetworkRequestMethodPUT,
GHNetworkRequestMethodDELETE,
GHNetworkRequestMethodPATCH
};
typedef NS_ENUM (NSUInteger, GHNetworkResponseStatus){
GHNetworkResponseStatusError = 0,
GHNetworkResponseStatusSuccess
};
typedef NS_ENUM (NSUInteger, GHEncryptType){
GHEncryptTypeNone = 0,
GHEncryptTypeBase64 = 1,
GHEncryptTypeMD5 // 32位加密&大写字母
};
typedef NS_ENUM (NSUInteger, GHNetworkContenType){
GHNetworkContenTypeFormURLEncoded = 0,
GHNetworkContenTypeJSON = 1,
GHNetworkContenTypeFormData = 2,
GHNetworkContenTypeXML = 3
};
typedef NS_ENUM (NSUInteger, GHNetworkSerializerType){
GHNetworkSerializerTypeHTTP = 0,
GHNetworkSerializerTypeJSON = 1,
GHNetworkSerializerTypePropertyList = 2
};
// 响应配置 Block
typedef void (^GHNetworkResponseBlock)(GHNetworkResponse * response);
typedef void (^GHGroupResponseBlock)(NSArray<GHNetworkResponse *> * responseObjects, BOOL isSuccess);
typedef void (^NextBlock)(GHNetworkRequest * request, GHNetworkResponse * responseObject, BOOL * isSent);
// 请求配置 Block
typedef void (^GHRequestConfigBlock)(GHNetworkRequest * request);
typedef void (^GHGroupRequestConfigBlock)(GHNetworkGroupRequest * groupRequest);
//typedef void (^ChainRequestConfigBlock)(GHNetworkChainRequest * chainRequest);
#endif /* GHNetworkConstant_h */