-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use first message as title if missing, secure retrieval by uuid
- Loading branch information
Showing
3 changed files
with
93 additions
and
22 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
interweb-server/src/main/java/de/l3s/interweb/server/PanacheUtils.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,20 @@ | ||
package de.l3s.interweb.server; | ||
|
||
import io.quarkus.panache.common.Sort; | ||
|
||
public final class PanacheUtils { | ||
public static Sort createSort(String order) { | ||
Sort sort = Sort.empty(); | ||
if (order != null) { | ||
String[] tokens = order.split(","); | ||
for (String token : tokens) { | ||
if (token.startsWith("-")) { | ||
sort = sort.and(token.substring(1), Sort.Direction.Descending); | ||
} else { | ||
sort = sort.and(token, Sort.Direction.Ascending); | ||
} | ||
} | ||
} | ||
return sort; | ||
} | ||
} |
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