Skip to content

Commit

Permalink
Merge pull request #39 from codingapi/3.x
Browse files Browse the repository at this point in the history
fix #38
  • Loading branch information
xlorne authored Jan 29, 2024
2 parents 6b9cd98 + d3d9509 commit c82ecc9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.7</version>
<version>3.1.8</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-parent</artifactId>
<version>3.1.9</version>
<version>3.1.10</version>

<url>https://github.com/codingapi/springboot-framewrok</url>
<name>springboot-parent</name>
Expand Down
2 changes: 1 addition & 1 deletion springboot-starter-data-fast/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>springboot-parent</artifactId>
<groupId>com.codingapi.springboot</groupId>
<version>3.1.9</version>
<version>3.1.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion springboot-starter-security-jwt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>springboot-parent</artifactId>
<groupId>com.codingapi.springboot</groupId>
<version>3.1.9</version>
<version>3.1.10</version>
</parent>

<artifactId>springboot-starter-security-jwt</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion springboot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-parent</artifactId>
<version>3.1.9</version>
<version>3.1.10</version>
</parent>
<artifactId>springboot-starter</artifactId>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,21 @@ public ClassContent(Class<?> clazz, PageRequest pageRequest) {

public void addFilter(String key, String value) {
Class<?> keyClass = getKeyType(key);
Object v = JSON.parseObject(value, keyClass);
Object v = parseObject(value, keyClass);
pageRequest.addFilter(key, Relation.EQUAL, v);
}

private Object parseObject(String value, Class<?> keyClass) {
if(value.getClass().equals(keyClass)) {
return value;
}
return JSON.parseObject(value, keyClass);
}

public void addFilter(String key, List<String> value) {
Class<?> keyClass = getKeyType(key);
pageRequest.addFilter(key, Relation.IN, value.stream()
.map(v -> JSON.parseObject(v, keyClass))
.map(v -> parseObject(v, keyClass))
.toArray()
);
}
Expand Down

0 comments on commit c82ecc9

Please sign in to comment.