Skip to content

Commit 6e532f5

Browse files
author
garenwang
committed
fix:修改参数校验
1 parent dfd0626 commit 6e532f5

File tree

9 files changed

+78
-49
lines changed

9 files changed

+78
-49
lines changed

Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ PODS:
66
- QCloudCOSXML/Default (= 6.2.6)
77
- QCloudCOSXML/Default (6.2.6):
88
- QCloudCore (= 6.2.6)
9-
- QCloudQuic (6.2.6):
10-
- QCloudQuic/Default (= 6.2.6)
11-
- QCloudQuic/Default (6.2.6)
9+
- QCloudQuic (6.2.7):
10+
- QCloudQuic/Default (= 6.2.7)
11+
- QCloudQuic/Default (6.2.7)
1212

1313
DEPENDENCIES:
1414
- QCloudCore (from `.`)
@@ -26,7 +26,7 @@ EXTERNAL SOURCES:
2626
SPEC CHECKSUMS:
2727
QCloudCore: b99da67cb77dfbe5ce585bc1fea0911eaf2ddb82
2828
QCloudCOSXML: 1704d7acb332103ac2559ddd5cc50c80c1738f6a
29-
QCloudQuic: b76e2c2641a6e94464762fb3b5a32c882bd09eb7
29+
QCloudQuic: 55367f6cd5f13ead49c38339f43079358da9910a
3030

3131
PODFILE CHECKSUM: 87053f234f38ae6a394978f26bcb119015f9918e
3232

QCloudCOSXML/Classes/CI/request/QCloudBatchimageRecognitionRequest.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ - (BOOL)buildRequestData:(NSError *__autoreleasing *)error {
180180
[freeze setObject:@(self.politicsScore).stringValue forKey:@"PoliticsScore"];
181181
}
182182

183-
[conf addEntriesFromDictionary:@{@"Freeze":freeze}];
183+
if(freeze.allKeys.count > 0){
184+
[conf addEntriesFromDictionary:@{@"Freeze":freeze}];
185+
}
184186

185187
NSDictionary * params =@{
186188
@"Input":inputs,

QCloudCOSXML/Classes/CI/request/QCloudPostAudioRecognitionRequest.m

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,16 @@ - (BOOL)buildRequestData:(NSError *__autoreleasing *)error {
121121
}
122122

123123
NSMutableDictionary * conf = @{
124-
@"Callback":self.callback?:@"",
125-
@"BizType":self.bizType?:@"",
126124
}.mutableCopy;
127125

126+
if(self.callback){
127+
[conf setObject:self.callback forKey:@"Callback"];
128+
}
129+
130+
if(self.bizType){
131+
[conf setObject:self.bizType forKey:@"BizType"];
132+
}
133+
128134
[conf addEntriesFromDictionary:@{@"CallbackVersion":@"Detail"}];
129135

130136
if(self.callbackType){
@@ -148,7 +154,10 @@ - (BOOL)buildRequestData:(NSError *__autoreleasing *)error {
148154
[freeze setObject:@(self.politicsScore).stringValue forKey:@"PoliticsScore"];
149155
}
150156

151-
[conf addEntriesFromDictionary:@{@"Freeze":freeze}];
157+
if(freeze.allKeys.count > 0){
158+
[conf addEntriesFromDictionary:@{@"Freeze":freeze}];
159+
}
160+
152161

153162
NSDictionary * params =@{
154163
@"Input":input.copy,

QCloudCOSXML/Classes/CI/request/QCloudPostDocRecognitionRequest.m

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,18 @@ - (BOOL)buildRequestData:(NSError *__autoreleasing *)error {
123123
}
124124

125125
NSMutableDictionary * conf = @{
126-
@"Callback":self.callback?:@"",
127-
@"BizType":self.bizType?:@"",
128126
@"CallbackVersion":@"Detail",
129127
@"CallbackType":@(self.callbackType).stringValue
130128
}.mutableCopy;
131129

130+
if(self.callback){
131+
[conf setObject:self.callback forKey:@"Callback"];
132+
}
133+
134+
if(self.bizType){
135+
[conf setObject:self.bizType forKey:@"BizType"];
136+
}
137+
132138
NSMutableDictionary * freeze = [NSMutableDictionary new];
133139
if(self.pornScore > -1){
134140
[freeze setObject:@(self.pornScore).stringValue forKey:@"PornScore"];
@@ -146,7 +152,9 @@ - (BOOL)buildRequestData:(NSError *__autoreleasing *)error {
146152
[freeze setObject:@(self.politicsScore).stringValue forKey:@"PoliticsScore"];
147153
}
148154

149-
[conf addEntriesFromDictionary:@{@"Freeze":freeze}];
155+
if(freeze.allKeys.count > 0){
156+
[conf addEntriesFromDictionary:@{@"Freeze":freeze}];
157+
}
150158

151159
NSDictionary * params =@{
152160
@"Input":input,

QCloudCOSXML/Classes/CI/request/QCloudPostTextRecognitionRequest.m

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,24 @@ - (BOOL)buildRequestData:(NSError *__autoreleasing *)error {
153153
}
154154

155155
NSMutableDictionary * conf = @{
156-
@"Callback":self.callback?:@"",
157-
@"BizType":self.bizType?:@"",
158156
}.mutableCopy;
159157

158+
159+
if(freeze.allKeys.count > 0){
160+
[conf setObject:freeze forKey:@"Freeze"];
161+
}
162+
163+
if(self.callback){
164+
[conf setObject:self.callback forKey:@"Callback"];
165+
}
166+
167+
if(self.bizType){
168+
[conf setObject:self.bizType forKey:@"BizType"];
169+
}
170+
171+
160172
[conf setObject:@"Detail" forKey:@"CallbackVersion"];
161-
[conf setObject:freeze forKey:@"Freeze"];
173+
162174
[conf setObject:@(self.callbackType).stringValue forKey:@"CallbackType"];
163175

164176
NSDictionary * params =@{

QCloudCOSXML/Classes/CI/request/QCloudPostVideoRecognitionRequest.m

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,21 +172,33 @@ - (BOOL)buildRequestData:(NSError *__autoreleasing *)error {
172172
[freeze setObject:@(self.politicsScore).stringValue forKey:@"PoliticsScore"];
173173
}
174174

175+
NSMutableDictionary * config = @{
176+
@"Snapshot":@{
177+
@"Mode":QCloudVideoRecognitionModeTransferToString(self.mode),
178+
@"TimeInterval":@(self.timeInterval),
179+
@"Count":@(self.count)
180+
},
181+
@"CallbackVersion":@"Detail",
182+
@"DetectContent":self.detectContent ?@"1":@"0",
183+
@"CallbackType":@(self.callbackType).stringValue,
184+
185+
}.mutableCopy;
186+
187+
if(freeze.allKeys.count > 0){
188+
[config setObject:freeze forKey:@"Freeze"];
189+
}
190+
191+
if(self.callback){
192+
[config setObject:self.callback forKey:@"Callback"];
193+
}
194+
195+
if(self.bizType){
196+
[config setObject:self.bizType forKey:@"BizType"];
197+
}
198+
175199
NSDictionary * params =@{
176200
@"Input":input,
177-
@"Conf":@{
178-
@"Snapshot":@{
179-
@"Mode":QCloudVideoRecognitionModeTransferToString(self.mode),
180-
@"TimeInterval":@(self.timeInterval),
181-
@"Count":@(self.count)
182-
},
183-
@"Callback":self.callback?:@"",
184-
@"BizType":self.bizType?:@"",
185-
@"CallbackVersion":@"Detail",
186-
@"DetectContent":self.detectContent ?@"1":@"0",
187-
@"CallbackType":@(self.callbackType).stringValue,
188-
@"Freeze":freeze
189-
}
201+
@"Conf":config
190202
};
191203

192204
[self.requestData setParameter:params withKey:@"Request"];

QCloudCOSXML/Classes/Transfer/request/QCloudGetObjectRequest.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ - (BOOL)buildRequestData:(NSError *__autoreleasing *)error {
126126
[self.requestData setValue:@(self.trafficLimit).stringValue forHTTPHeaderField:@"x-cos-traffic-limit"];
127127
}
128128

129+
[self.customHeaders setObject:@"no-cache" forKey:@"Cache-Control"];
130+
129131
NSURL *__serverURL = [self.runOnService.configuration.endpoint serverURLWithBucket:self.bucket
130132
appID:self.runOnService.configuration.appID
131133
regionName:self.regionName];
Binary file not shown.

QCloudCOSXMLDemo.xcworkspace/xcuserdata/garenwang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,17 @@
77
<BreakpointProxy
88
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
99
<BreakpointContent
10-
uuid = "BCF3D2A1-32A1-40EA-9471-0E01F7205DB9"
10+
uuid = "997680CB-C74A-4020-90BE-04D0BF2391BC"
1111
shouldBeEnabled = "Yes"
1212
ignoreCount = "0"
1313
continueAfterRunningActions = "No"
14-
filePath = "QCloudCore/Classes/Base/QCLOUDRestNet/DNSCache/QCloudHttpDNS.m"
14+
filePath = "QCloudCore/Classes/Base/QCLOUDObjectModel/QCloudClassInfo.m"
1515
startingColumnNumber = "9223372036854775807"
1616
endingColumnNumber = "9223372036854775807"
17-
startingLineNumber = "226"
18-
endingLineNumber = "226"
19-
landmarkName = "getIPListFromToHost(mHost, mPort)"
20-
landmarkType = "9">
21-
</BreakpointContent>
22-
</BreakpointProxy>
23-
<BreakpointProxy
24-
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
25-
<BreakpointContent
26-
uuid = "2AA966A4-2E82-4BCB-A5E0-2D45F490F8DD"
27-
shouldBeEnabled = "Yes"
28-
ignoreCount = "0"
29-
continueAfterRunningActions = "No"
30-
filePath = "QCloudCore/Classes/Base/QCLOUDRestNet/DNSCache/QCloudHttpDNS.m"
31-
startingColumnNumber = "9223372036854775807"
32-
endingColumnNumber = "9223372036854775807"
33-
startingLineNumber = "253"
34-
endingLineNumber = "253"
35-
landmarkName = "getIPListFromToHost(mHost, mPort)"
36-
landmarkType = "9">
17+
startingLineNumber = "263"
18+
endingLineNumber = "263"
19+
landmarkName = "-initWithProperty:"
20+
landmarkType = "7">
3721
</BreakpointContent>
3822
</BreakpointProxy>
3923
</Breakpoints>

0 commit comments

Comments
 (0)