Löschen von Nachrichten aus dem Archiv implementiert. Dies Löst #2

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2024-03-15 11:22:58 +01:00
parent 8be07ed6ae
commit 89fda62c9d
7 changed files with 56 additions and 8 deletions

View File

@@ -141,6 +141,10 @@ public class Post {
return id;
}
public MailingList list() {
return list;
}
public static Post load(String id) throws SQLException {
var rs = Database.open().select(TABLE_NAME).where(ID,id).compile().exec();
try {
@@ -161,6 +165,11 @@ public class Post {
FILE,filename);
}
public void remove() throws SQLException {
Database.open().deleteFrom(TABLE_NAME).where(ID,id).compile().run();
file().delete();
}
public Map<String,Object> safeMap() {
return Map.of(ID,id,
LIST,list.name(),
@@ -186,5 +195,4 @@ public class Post {
public long timestamp(){
return timestamp;
}
}