JLChen
2021-11-04 1443556e9ccb1a19ed8e6710c16c8adc4d4f4fb3
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
//
//  Copyright © 2019 dahua. All rights reserved.
//
 
#import "LCRequestModel.h"
#import "LCApplicationDataManager.h"
 
@implementation LCRequestSystemModel
 
-(instancetype)init{
    if (self = [super init]) {
        //获取nonce随机字符
        self.nonce = [LCApplicationDataManager serial];
        self.time = [LCApplicationDataManager getCurrentTimeStamp];
        self.ver = @"1.0";
        self.appId = [LCApplicationDataManager appId];
        self.sign = [self getSign];
    }
    return self;
}
 
-(NSString *)getSign{
    NSString * signStr = [NSString stringWithFormat:@"time:%@,nonce:%@,appSecret:%@",self.time,self.nonce,[LCApplicationDataManager appSecret]];
    return [signStr lc_MD5Digest];
}
 
@end
 
@implementation LCRequestModel
 
//MARK: - Public Methods
 
+(instancetype)lc_WrapperNetworkRequestPackageWithParams:(id)params{
    LCRequestModel * model = [[LCRequestModel alloc] initWithParams:params];
    return model;
}
 
//MARK: - Private Methods
-(instancetype)initWithParams:(id)params{
    if (self = [super init]) {
        //请求消息ID号,可以传入任意字符串
        self.identifier = [LCApplicationDataManager serial];
        self.system = [LCRequestSystemModel new];
        _params = params;
    }
    return self;
}
 
+(NSDictionary *)mj_replacedKeyFromPropertyName{
    return @{
             @"identifier":@"id"
             };
}
 
 
 
 
 
 
@end