Skip to content

Commit 25d681b

Browse files
committed
fix getExample()
1 parent e38b62c commit 25d681b

File tree

7 files changed

+26
-7
lines changed

7 files changed

+26
-7
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>3.1.2</version>
9+
<version>3.1.4</version>
1010
<relativePath/> <!-- lookup parent from repository -->
1111
</parent>
1212

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

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

springboot-starter-data-fast/pom.xml

Lines changed: 1 addition & 1 deletion
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>3.1.2</version>
8+
<version>3.1.3</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

springboot-starter-data-fast/src/main/java/com/codingapi/springboot/fast/query/QueryRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public <T> Example<T> getExample() {
3939
PageRequest.Filter value = request.getFilters().get(name);
4040
if (value != null) {
4141
try {
42-
descriptor.getWriteMethod().invoke(entity, value.getValue()[0]);
42+
descriptor.getWriteMethod().invoke(entity, value.getFilterValue(descriptor.getPropertyType()));
4343
} catch (Exception e) {
4444
}
4545
}

springboot-starter-id-generator/pom.xml

Lines changed: 1 addition & 1 deletion
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>3.1.2</version>
8+
<version>3.1.3</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

springboot-starter-security-jwt/pom.xml

Lines changed: 1 addition & 1 deletion
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>3.1.2</version>
9+
<version>3.1.3</version>
1010
</parent>
1111

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

springboot-starter/pom.xml

Lines changed: 1 addition & 1 deletion
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>3.1.2</version>
8+
<version>3.1.3</version>
99
</parent>
1010
<artifactId>springboot-starter</artifactId>
1111

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,25 @@ public boolean isLessThanEqual() {
249249
return relation == FilterRelation.LESS_THAN_EQUAL;
250250
}
251251

252+
public Object getFilterValue(Class<?> clazz) {
253+
Object val = value[0];
254+
if(val instanceof String) {
255+
if(clazz == Integer.class) {
256+
return Integer.parseInt((String)val);
257+
}
258+
if(clazz == Long.class) {
259+
return Long.parseLong((String)val);
260+
}
261+
if(clazz == Double.class) {
262+
return Double.parseDouble((String)val);
263+
}
264+
if(clazz == Float.class) {
265+
return Float.parseFloat((String)val);
266+
}
267+
}
268+
return value[0];
269+
}
270+
252271
}
253272

254273
private void putFilter(String key, FilterRelation relation, Object... val) {

0 commit comments

Comments
 (0)