implemented transition from old bookmark database (tags.db) to separate database for bookmarks and tags
This commit is contained in:
@@ -13,20 +13,20 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public record Bookmark(long id, String url, String comment, LocalDateTime timestamp, Collection<String> tags) implements Mappable {
|
||||
public record Bookmark(long urlId, String url, String comment, LocalDateTime timestamp, Collection<String> tags) implements Mappable {
|
||||
|
||||
public static Bookmark of(ResultSet rs) throws SQLException {
|
||||
return new Bookmark(rs.getLong(ID),rs.getString(URL),rs.getString(COMMENT),LocalDateTime.ofEpochSecond(rs.getLong(TIMESTAMP),0, UTC),new ArrayList<>());
|
||||
}
|
||||
|
||||
public static Bookmark of(long id, String url, String comment, LocalDateTime timestamp){
|
||||
return new Bookmark(id,url,comment,timestamp,new ArrayList<>());
|
||||
public static Bookmark of(long urlId, String url, String comment, LocalDateTime timestamp){
|
||||
return new Bookmark(urlId,url,comment,timestamp,new ArrayList<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> toMap() {
|
||||
return Map.of(
|
||||
ID,id,
|
||||
ID, urlId,
|
||||
URL, url,
|
||||
COMMENT, Map.of(SOURCE,comment,RENDERED,markdown(comment)),
|
||||
TAGS, tags,
|
||||
|
||||
Reference in New Issue
Block a user