basic-contract is a simple controller reuse component. includes some reusable abstract for using in controller such as Page, PageSlice, Filter and Sorter.
Provided class as follows:
-
Page
indicates page limit and size
-
PageSlice
indicates page slice for specified
Page
-
Filter
indicates how to filter database row
-
Sorter
sorting data for database query result
-
ApiResponse
return any unified response for web api
-
FilterConverter
convert string to
Filter
object -
SorterConverter
conver string to
Sorter
object
snapshot is uploaded.
<dependency>
<groupId>com.codimiracle.web</groupId>
<artifactId>basic-contract</artifactId>
<version>1.0.1-SNAPSHOT</version>
</dependency>
Simply, you can use in everywhere, but those is design for spring boot controller layer. you can use those class like:
// in ExampleController.java
public ApiResponse query(Filter filter, Sorter sorter, @ModelAttribute Page page) {
//...listing example
PageSlice slice = null;
return new ApiResponse(0, "success", slice);
}