Skip to content

Commit a0db527

Browse files
committed
1 parent 9c726e3 commit a0db527

File tree

7 files changed

+24
-14
lines changed

7 files changed

+24
-14
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>com.codingapi.springboot</groupId>
1414
<artifactId>springboot-parent</artifactId>
15-
<version>2.8.3</version>
15+
<version>2.8.4</version>
1616

1717
<url>https://github.com/codingapi/springboot-framewrok</url>
1818
<name>springboot-parent</name>

springboot-starter-data-fast/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-parent</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>2.8.3</version>
8+
<version>2.8.4</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

springboot-starter-security/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>2.8.3</version>
9+
<version>2.8.4</version>
1010
</parent>
1111

1212
<artifactId>springboot-starter-security</artifactId>

springboot-starter/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.codingapi.springboot</groupId>
77
<artifactId>springboot-parent</artifactId>
8-
<version>2.8.3</version>
8+
<version>2.8.4</version>
99
</parent>
1010
<artifactId>springboot-starter</artifactId>
1111

springboot-starter/src/main/java/com/codingapi/springboot/framework/dto/request/Filter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public Filter(String key, Object... value) {
2525
}
2626

2727
public Filter(String key, Filter... value) {
28-
this(key, null, value);
28+
this(key, null, value);
2929
}
3030

3131
public static Filter as(String key, Relation relation, Object... value) {

springboot-starter/src/main/java/com/codingapi/springboot/framework/dto/request/SearchRequest.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.util.Base64;
1717
import java.util.Enumeration;
1818
import java.util.List;
19+
import java.util.stream.Collectors;
1920

2021
/**
2122
* HttpServletRequest 请求参数解析成 PageRequest对象
@@ -211,15 +212,17 @@ public PageRequest toPageRequest(Class<?> clazz) {
211212
for (String key : jsonObject.keySet()) {
212213
JSONArray value = jsonObject.getJSONArray(key);
213214
if (value != null && !value.isEmpty()) {
214-
List<String> values = value.stream().map(Object::toString).toList();
215+
List<String> values = value.stream().map(Object::toString).collect(Collectors.toList());
215216
content.addFilter(key, values);
216217
}
217218
}
218219
}
219220
}
220221

222+
Enumeration<String> enumeration = request.getParameterNames();
221223

222-
request.getParameterNames().asIterator().forEachRemaining(key -> {
224+
while (enumeration.hasMoreElements()){
225+
String key = enumeration.nextElement();
223226
if (!removeKeys.contains(key)) {
224227
String value = request.getParameter(key);
225228
if (StringUtils.hasLength(value)) {
@@ -238,8 +241,7 @@ public PageRequest toPageRequest(Class<?> clazz) {
238241
}
239242
}
240243
}
241-
});
242-
244+
}
243245
return pageRequest;
244246
}
245247

springboot-starter/src/test/java/com/codingapi/springboot/framework/rest/RestClientTest.java

+13-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.codingapi.springboot.framework.rest.properties.HttpProxyProperties;
66
import lombok.extern.slf4j.Slf4j;
77
import org.junit.jupiter.api.Test;
8+
import org.springframework.http.HttpHeaders;
89

910
import java.net.Proxy;
1011

@@ -21,14 +22,21 @@ void okxTest() {
2122
proxyProperties.setProxyType(Proxy.Type.HTTP);
2223
proxyProperties.setProxyHost("127.0.0.1");
2324
proxyProperties.setProxyPort(7890);
25+
26+
HttpHeaders headers = new HttpHeaders();
27+
headers.set("x-simulated-trading","1");
28+
headers.set("User-Agent", "Application");
2429
RestClient restClient = new RestClient(proxyProperties,baseUrl,5,"{}",null,null);
25-
String response = restClient.get("api/v5/market/candles", RestParam.create()
26-
.add("instId","BTC-USDT")
27-
.add("bar","1m")
28-
.add("limit","300")
30+
String response = restClient.get(
31+
"api/v5/market/candles",
32+
headers,
33+
RestParam.create()
34+
.add("instId","BTC-USDT")
35+
.add("bar","1m")
36+
.add("limit","300")
2937
);
3038
log.info("response:{}",response);
3139
JSONObject jsonObject = JSONObject.parseObject(response);
3240
assertEquals(jsonObject.getJSONArray("data").size(),300);
3341
}
34-
}
42+
}

0 commit comments

Comments
 (0)