working on notes
This commit is contained in:
@@ -73,6 +73,7 @@ public class Constants {
|
||||
public static final String NEW_MEMBER = "new_member";
|
||||
public static final String MIME = "mime";
|
||||
public static final String NO_INDEX = "no_index";
|
||||
public static final String NOTE = "note";
|
||||
public static final String NUMBER = "number";
|
||||
|
||||
public static final String OPTIONAL = "optional";
|
||||
|
||||
@@ -6,11 +6,12 @@ import de.srsoftware.umbrella.core.model.Note;
|
||||
import de.srsoftware.umbrella.core.model.UmbrellaUser;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public interface NoteService {
|
||||
void deleteEntity(String task, long taskId);
|
||||
|
||||
Collection<Note> getNotes(String module, long entityId) throws UmbrellaException;
|
||||
Map<Long,Note> getNotes(String module, long entityId) throws UmbrellaException;
|
||||
|
||||
Note save(Note note);
|
||||
}
|
||||
|
||||
@@ -6,10 +6,12 @@ import de.srsoftware.tools.Mappable;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.Map;
|
||||
|
||||
import static de.srsoftware.umbrella.core.Constants.*;
|
||||
import static de.srsoftware.umbrella.core.Util.markdown;
|
||||
import static java.time.ZoneOffset.UTC;
|
||||
|
||||
public record Note(long id, String module, long entityId, long authorId, String text, LocalDateTime timestamp) implements Mappable {
|
||||
public static Note of(ResultSet rs) throws SQLException {
|
||||
@@ -18,8 +20,8 @@ public record Note(long id, String module, long entityId, long authorId, String
|
||||
rs.getString(MODULE),
|
||||
rs.getLong(ENTITY_ID),
|
||||
rs.getLong(USER_ID),
|
||||
rs.getString(TEXT),
|
||||
LocalDateTime.parse(rs.getString(TIMESTAMP))
|
||||
rs.getString(NOTE),
|
||||
LocalDateTime.ofEpochSecond(rs.getLong(TIMESTAMP),0, UTC)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user