File tree 4 files changed +49
-0
lines changed
controllers/au/org/ala/spatial
services/au/org/ala/spatial
4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,20 @@ class ChecklistController {
75
75
schema = @Schema (implementation = String ),
76
76
description = " Object ID to filter" ,
77
77
required = false
78
+ ),
79
+ @Parameter (
80
+ name = " start" ,
81
+ in = QUERY ,
82
+ schema = @Schema (implementation = String ),
83
+ description = " Starting index for pagination" ,
84
+ required = false
85
+ ),
86
+ @Parameter (
87
+ name = " pageSize" ,
88
+ in = QUERY ,
89
+ schema = @Schema (implementation = String ),
90
+ description = " Page size for pagination" ,
91
+ required = false
78
92
)
79
93
],
80
94
responses = [
Original file line number Diff line number Diff line change @@ -77,6 +77,20 @@ class DistributionController {
77
77
schema = @Schema (implementation = String ),
78
78
description = " Object ID to filter" ,
79
79
required = false
80
+ ),
81
+ @Parameter (
82
+ name = " start" ,
83
+ in = QUERY ,
84
+ schema = @Schema (implementation = String ),
85
+ description = " Starting index for pagination" ,
86
+ required = false
87
+ ),
88
+ @Parameter (
89
+ name = " pageSize" ,
90
+ in = QUERY ,
91
+ schema = @Schema (implementation = String ),
92
+ description = " Page size for pagination" ,
93
+ required = false
80
94
)
81
95
],
82
96
responses = [
Original file line number Diff line number Diff line change @@ -76,6 +76,20 @@ class TrackController {
76
76
schema = @Schema (implementation = String ),
77
77
description = " Object ID to filter" ,
78
78
required = false
79
+ ),
80
+ @Parameter (
81
+ name = " start" ,
82
+ in = QUERY ,
83
+ schema = @Schema (implementation = String ),
84
+ description = " Starting index for pagination" ,
85
+ required = false
86
+ ),
87
+ @Parameter (
88
+ name = " pageSize" ,
89
+ in = QUERY ,
90
+ schema = @Schema (implementation = String ),
91
+ description = " Page size for pagination" ,
92
+ required = false
79
93
)
80
94
],
81
95
responses = [
Original file line number Diff line number Diff line change @@ -123,6 +123,13 @@ class DistributionsService {
123
123
sql + = " WHERE " + whereClause. toString()
124
124
}
125
125
126
+ if (queryParams. pageSize) {
127
+ int start = queryParams. start as Integer ?: 0
128
+ sql + = " LIMIT :pageSize OFFSET :offset"
129
+ params. put(" pageSize" , queryParams. pageSize as Integer )
130
+ params. put(" offset" , start)
131
+ }
132
+
126
133
List result = new ArrayList ()
127
134
128
135
String [] fields = SELECT_CLAUSE . split(' ,' )
You can’t perform that action at this time.
0 commit comments