Add possibility to share notes
This commit is contained in:
@@ -29,6 +29,7 @@ data class PersistedNote(
|
||||
val html: String,
|
||||
val updatedAt: LocalDateTime,
|
||||
val uuid: UUID,
|
||||
val public: Boolean,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
|
||||
@@ -88,6 +88,10 @@ class NoteService(
|
||||
fun search(userId: Int, searchTerms: SearchTerms) = searcher.search(userId, searchTerms)
|
||||
|
||||
fun dropAllIndexes() = searcher.dropAll()
|
||||
|
||||
fun makePublic(userId: Int, uuid: UUID) = noteRepository.makePublic(userId, uuid)
|
||||
fun makePrivate(userId: Int, uuid: UUID) = noteRepository.makePrivate(userId, uuid)
|
||||
fun findPublic(uuid: UUID) = noteRepository.findPublic(uuid)
|
||||
}
|
||||
|
||||
data class PaginatedNotes(val pages: Int, val notes: List<PersistedNoteMetadata>)
|
||||
|
||||
@@ -28,4 +28,8 @@ interface NoteRepository {
|
||||
fun update(userId: Int, uuid: UUID, note: Note): PersistedNote?
|
||||
fun export(userId: Int): List<ExportedNote>
|
||||
fun findAllDetails(userId: Int): List<PersistedNote>
|
||||
|
||||
fun makePublic(userId: Int, uuid: UUID): Boolean
|
||||
fun makePrivate(userId: Int, uuid: UUID): Boolean
|
||||
fun findPublic(uuid: UUID): PersistedNote?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user