-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'elasticsearch-20240519-squash'
- Loading branch information
Showing
39 changed files
with
930 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/java/biblivre/administration/accesscards/PagedAccessCardSearchDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package biblivre.administration.accesscards; | ||
|
||
public record PagedAccessCardSearchDTO( | ||
String code, AccessCardStatus status, int limit, int offset) {} |
28 changes: 28 additions & 0 deletions
28
src/main/java/biblivre/administration/accesscards/PagedAccessCardSearchWebHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package biblivre.administration.accesscards; | ||
|
||
import biblivre.core.ExtendedRequest; | ||
import biblivre.core.configurations.ConfigurationBO; | ||
import biblivre.core.utils.Constants; | ||
import org.json.JSONObject; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class PagedAccessCardSearchWebHelper { | ||
@Autowired private ConfigurationBO configurationBO; | ||
|
||
public PagedAccessCardSearchDTO getPagedAccessCardSearchDTO(ExtendedRequest request) { | ||
String searchParameters = request.getString("search_parameters"); | ||
|
||
JSONObject json = new JSONObject(searchParameters); | ||
String query = json.optString("query"); | ||
var status = AccessCardStatus.fromString(json.optString("status")); | ||
|
||
Integer limit = | ||
request.getInteger( | ||
"limit", configurationBO.getInt(Constants.CONFIG_SEARCH_RESULTS_PER_PAGE)); | ||
int offset = (request.getInteger("page", 1) - 1) * limit; | ||
|
||
return new PagedAccessCardSearchDTO(query, status, limit, offset); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.