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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user