Add possibility to share notes

This commit is contained in:
2020-08-25 06:18:18 +02:00
parent 1cb6c731d8
commit c5f9a1d6e0
11 changed files with 128 additions and 21 deletions
+1
View File
@@ -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?
}