Skip to content

Commit c7c6dcc

Browse files
committed
update MultiResponse & update version 1.2.0
1 parent 47ec8be commit c7c6dcc

File tree

7 files changed

+24
-13
lines changed

7 files changed

+24
-13
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<groupId>com.codingapi.springboot</groupId>
1313
<artifactId>springboot-parent</artifactId>
14-
<version>1.1.8</version>
14+
<version>1.2.0</version>
1515

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

springboot-example/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.codingapi.springboot</groupId>
66
<artifactId>springboot-parent</artifactId>
7-
<version>1.1.8</version>
7+
<version>1.2.0</version>
88
</parent>
99
<artifactId>springboot-example</artifactId>
1010

springboot-starter-data-permission/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>1.1.8</version>
9+
<version>1.2.0</version>
1010
</parent>
1111

1212

springboot-starter-leaf/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>1.1.8</version>
8+
<version>1.2.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

springboot-starter-security-jwt/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>1.1.8</version>
9+
<version>1.2.0</version>
1010
</parent>
1111

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

springboot-starter/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.codingapi.springboot</groupId>
66
<artifactId>springboot-parent</artifactId>
7-
<version>1.1.8</version>
7+
<version>1.2.0</version>
88
</parent>
99
<artifactId>springboot-starter</artifactId>
1010

springboot-starter/src/main/java/com/codingapi/springboot/framework/dto/response/MultiResponse.java

+18-7
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,23 @@
1414
@Getter
1515
public class MultiResponse<T> extends Response {
1616

17-
private long total;
1817

19-
private Collection<T> data;
18+
private Content<T> data;
19+
20+
@Setter
21+
@Getter
22+
public static class Content<T>{
23+
private long total;
24+
private Collection<T> list;
25+
}
2026

2127
public static <T> MultiResponse<T> of(Collection<T> data, long total) {
2228
MultiResponse<T> multiResponse = new MultiResponse<>();
2329
multiResponse.setSuccess(true);
24-
multiResponse.setData(data);
25-
multiResponse.setTotal(total);
30+
Content<T> content = new Content<>();
31+
content.setTotal(total);
32+
content.setList(data);
33+
multiResponse.setData(content);
2634
return multiResponse;
2735
}
2836

@@ -36,20 +44,23 @@ public static <T> MultiResponse<T> empty() {
3644
MultiResponse<T> multiResponse = new MultiResponse<>();
3745
multiResponse.setSuccess(true);
3846
multiResponse.setData(null);
39-
multiResponse.setTotal(0);
47+
Content<T> content = new Content<>();
48+
content.setTotal(0);
49+
content.setList(null);
4050
return multiResponse;
4151
}
4252

4353

4454
public static <T> MultiResponse<T> of(Collection<T> data) {
4555
MultiResponse<T> multiResponse = new MultiResponse<>();
4656
multiResponse.setSuccess(true);
47-
multiResponse.setData(data);
4857
long total = 0;
4958
if(data!=null){
5059
total = data.size();
5160
}
52-
multiResponse.setTotal(total);
61+
Content<T> content = new Content<>();
62+
content.setTotal(total);
63+
content.setList(data);
5364
return multiResponse;
5465
}
5566

0 commit comments

Comments
 (0)