JLChen
2021-05-13 7f62f2d3bf626ac55d2d2de05ca1d71eaaabef39
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//
//  LCOpenSDK_Api.h
//  LCOpenSDK
//
//  Created by chenjian on 16/5/16.
//  Copyright (c) 2016年 lechange. All rights reserved.
//
 
#ifndef LCOpenSDK_LCOpenSDK_Api_h
#define LCOpenSDK_LCOpenSDK_Api_h
#import <Foundation/Foundation.h>
 
/** [int]:协议类型 0-http 1-https */
typedef NS_ENUM(NSInteger, ProcotolType) {
    PROCOTOL_TYPE_HTTP = 0,
    PROCOTOL_TYPE_HTTPS
};
 
@interface LCOpenSDK_ApiParam: NSObject
 
@property (nonatomic) ProcotolType             procotol; /** 协议类型 */
@property (nonatomic, copy, nonnull) NSString *addr; /** 地址 */
@property (nonatomic)NSInteger                 port; /** 端口 */
@property (nonatomic, copy, nonnull) NSString *token; /** token */
 
@end
 
@interface LCOpenSDK_Api: NSObject
/**
 *  获取LCOpenSDK_Api单例
 *
 *  @return LCOpenSDK_Api单例指针
 */
+ (LCOpenSDK_Api*_Nonnull) shareMyInstance;
 
/**
 *  初始化LCOpenSDK_Api
 *
 *  @param procotol 协议
 *  @param addr     域名
 *  @param port     端口
 *  @param caPath   CA证书路径
 *
 *  @return LCOpenSDK_Api指针
 */
- (id _Nonnull)initOpenApi:(ProcotolType)procotol addr:(NSString *_Nonnull)addr port:(NSInteger)port CA_PATH:(NSString *_Nonnull)caPath DEPRECATED_MSG_ATTRIBUTE("use initOpenApi: instead");
 
/**
*  初始化LCOpenSDK_Api
*
*  @param apiParam 参数模型
*
*  @return LCOpenSDK_Api指针
*/
- (id _Nonnull)initOpenApi:(LCOpenSDK_ApiParam *_Nonnull)apiParam;
 
/**
*  LCOpenSDK_Api请求返回值
*
*  @param req     结构化请求体
*  @param resp    结构化返回体
*  @param timeout 超时时长
*
*  @return      0, 接口调用成功
*              -1, 接口调用失败
*/
 
- (NSInteger)request:(void *_Nonnull)req resp:(void *_Nonnull)resp timeout:(NSInteger)timeout;
/**
 *  反初始化LCOpenSDK_Api接口
 */
- (void)uninitOpenApi;
 
@end
#endif