started first part of transition: importing bookmarks from tags.db to bookmarks.db
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
package de.srsoftware.umbrella.bookmarks;
|
||||
|
||||
import de.srsoftware.umbrella.core.model.Bookmark;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -10,5 +12,9 @@ public interface BookmarkDb {
|
||||
|
||||
Bookmark load(long id, long userId);
|
||||
|
||||
Bookmark save(String url, String comment, Collection<Long> userIds);
|
||||
Bookmark save(String url, String comment, Collection<Long> userIds, LocalDateTime datetime);
|
||||
|
||||
default Bookmark save(String url, String comment, Collection<Long> userIds){
|
||||
return save(url,comment,userIds,LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,9 +99,8 @@ CREATE TABLE IF NOT EXISTS {0} (
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bookmark save(String url, String comment, Collection<Long> userIds) {
|
||||
public Bookmark save(String url, String comment, Collection<Long> userIds, LocalDateTime timestamp) {
|
||||
try {
|
||||
var timestamp = LocalDateTime.now();
|
||||
var rs = select(ID).from(TABLE_URLS).where(URL, equal(url)).exec(db);
|
||||
var id = 0L;
|
||||
if (rs.next()) id = rs.getLong(ID);
|
||||
|
||||
Reference in New Issue
Block a user