Added operation for deleting outfits
This commit is contained in:
parent
24d1cd7425
commit
1d8dcacd8a
@ -200,6 +200,16 @@ public class OutfitController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static CompletableFuture<Void> forceRemove(String id) {
|
||||||
|
return CompletableFuture.runAsync(() -> {
|
||||||
|
try {
|
||||||
|
forceRemoveExec(id);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new CompletionException(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private static void insertExec(Outfit outfit) throws SQLException {
|
private static void insertExec(Outfit outfit) throws SQLException {
|
||||||
if (outfit.getCreated() == null) {
|
if (outfit.getCreated() == null) {
|
||||||
outfit.setCreated(new Timestamp(System.currentTimeMillis()));
|
outfit.setCreated(new Timestamp(System.currentTimeMillis()));
|
||||||
@ -369,6 +379,10 @@ public class OutfitController {
|
|||||||
FSDB.get().query("UPDATE outfits SET deleted = true WHERE id = ?", id);
|
FSDB.get().query("UPDATE outfits SET deleted = true WHERE id = ?", id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void forceRemoveExec(String id) throws SQLException {
|
||||||
|
FSDB.get().query("DELETE FROM outfits WHERE id = ?", id);
|
||||||
|
}
|
||||||
|
|
||||||
private static Optional<Collection<Outfit>> extractMultiple(ResultSet rs) throws SQLException {
|
private static Optional<Collection<Outfit>> extractMultiple(ResultSet rs) throws SQLException {
|
||||||
Collection<Outfit> outfits = new ArrayList<>();
|
Collection<Outfit> outfits = new ArrayList<>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user