Skip to content

Commit

Permalink
add SearchRequest#getParameterNames method
Browse files Browse the repository at this point in the history
  • Loading branch information
xlorne committed May 31, 2024
1 parent 5c448ff commit 49604b0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.codingapi.springboot</groupId>
<artifactId>springboot-parent</artifactId>
<version>3.2.1</version>
<version>3.2.2</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.2.1</version>
<version>3.2.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion springboot-starter-security/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.2.1</version>
<version>3.2.2</version>
</parent>

<artifactId>springboot-starter-security</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.2.1</version>
<version>3.2.2</version>
</parent>
<artifactId>springboot-starter</artifactId>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Enumeration;
import java.util.List;

/**
* HttpServletRequest 请求参数解析成 PageRequest对象
*/
public class SearchRequest {

@Getter
private int current;
@Getter
private int pageSize;

private final HttpServletRequest request;
Expand Down Expand Up @@ -63,6 +66,16 @@ public String[] getParameterValues(String key) {
return request.getParameterValues(key);
}


public List<String> getParameterNames() {
Enumeration<String> enumeration = request.getParameterNames();
List<String> list = new ArrayList<>();
while (enumeration.hasMoreElements()) {
list.add(enumeration.nextElement());
}
return list;
}

public PageRequest addFilter(String key, Relation relation, Object... value) {
return pageRequest.addFilter(key, relation, value);
}
Expand Down

0 comments on commit 49604b0

Please sign in to comment.