File tree Expand file tree Collapse file tree
springboot-starter-data-authorization
springboot-starter-data-fast
springboot-starter-security
src/main/java/com/codingapi/springboot/framework Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616 <groupId >com.codingapi.springboot</groupId >
1717 <artifactId >springboot-parent</artifactId >
18- <version >2.10.29 </version >
18+ <version >2.10.30 </version >
1919
2020 <url >https://github.com/codingapi/springboot-framewrok</url >
2121 <name >springboot-parent</name >
Original file line number Diff line number Diff line change 66 <parent >
77 <artifactId >springboot-parent</artifactId >
88 <groupId >com.codingapi.springboot</groupId >
9- <version >2.10.29 </version >
9+ <version >2.10.30 </version >
1010 </parent >
1111
1212 <name >springboot-starter-data-authorization</name >
Original file line number Diff line number Diff line change 55 <parent >
66 <artifactId >springboot-parent</artifactId >
77 <groupId >com.codingapi.springboot</groupId >
8- <version >2.10.29 </version >
8+ <version >2.10.30 </version >
99 </parent >
1010 <modelVersion >4.0.0</modelVersion >
1111
Original file line number Diff line number Diff line change 66 <parent >
77 <artifactId >springboot-parent</artifactId >
88 <groupId >com.codingapi.springboot</groupId >
9- <version >2.10.29 </version >
9+ <version >2.10.30 </version >
1010 </parent >
1111
1212 <name >springboot-starter-flow</name >
Original file line number Diff line number Diff line change 66 <parent >
77 <artifactId >springboot-parent</artifactId >
88 <groupId >com.codingapi.springboot</groupId >
9- <version >2.10.29 </version >
9+ <version >2.10.30 </version >
1010 </parent >
1111
1212 <artifactId >springboot-starter-security</artifactId >
Original file line number Diff line number Diff line change 55 <parent >
66 <groupId >com.codingapi.springboot</groupId >
77 <artifactId >springboot-parent</artifactId >
8- <version >2.10.29 </version >
8+ <version >2.10.30 </version >
99 </parent >
1010 <artifactId >springboot-starter</artifactId >
1111
Original file line number Diff line number Diff line change 1+ package com .codingapi .springboot .framework .context ;
2+
3+ import com .codingapi .springboot .framework .dto .ICurrentOffset ;
4+ import com .codingapi .springboot .framework .dto .request .PageRequest ;
5+ import lombok .Getter ;
6+ import lombok .Setter ;
7+
8+ public class CurrentPageOffsetContext implements ICurrentPageOffset {
9+
10+ @ Getter
11+ private static final CurrentPageOffsetContext instance = new CurrentPageOffsetContext ();
12+
13+ private CurrentPageOffsetContext (){}
14+
15+ @ Setter
16+ private ICurrentPageOffset currentPageOffset = new ICurrentPageOffset (){
17+ @ Override
18+ public int getCurrentPage (ICurrentOffset target , int current ) {
19+ if (target instanceof PageRequest ){
20+ return current ;
21+ }
22+ return current - 1 ;
23+ }
24+ };
25+
26+ public int getCurrentPage (ICurrentOffset target ,int current ) {
27+ return currentPageOffset .getCurrentPage (target ,current );
28+ }
29+
30+ }
Original file line number Diff line number Diff line change 1+ package com .codingapi .springboot .framework .context ;
2+
3+ import com .codingapi .springboot .framework .dto .ICurrentOffset ;
4+
5+ public interface ICurrentPageOffset {
6+
7+ int getCurrentPage (ICurrentOffset target , int current );
8+ }
Original file line number Diff line number Diff line change 1+ package com .codingapi .springboot .framework .dto ;
2+
3+ public interface ICurrentOffset {
4+
5+ void setCurrent (int current );
6+
7+ }
Original file line number Diff line number Diff line change 11package com .codingapi .springboot .framework .dto .request ;
22
3+ import com .codingapi .springboot .framework .context .CurrentPageOffsetContext ;
4+ import com .codingapi .springboot .framework .dto .ICurrentOffset ;
35import lombok .Getter ;
46import lombok .Setter ;
57import org .springframework .data .domain .Sort ;
68
7- public class PageRequest extends org .springframework .data .domain .PageRequest {
9+ public class PageRequest extends org .springframework .data .domain .PageRequest implements ICurrentOffset {
810
911 @ Getter
10- @ Setter
1112 private int current ;
1213
1314 @ Setter
@@ -32,6 +33,10 @@ public PageRequest() {
3233 this (0 , 20 , Sort .unsorted ());
3334 }
3435
36+ public void setCurrent (int current ) {
37+ this .current = CurrentPageOffsetContext .getInstance ().getCurrentPage (this ,current );
38+ }
39+
3540 public String getStringFilter (String key ) {
3641 return requestFilter .getStringFilter (key );
3742 }
You can’t perform that action at this time.
0 commit comments