Move types into simplenotes-types module
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>simplenotes-parent</artifactId>
|
||||
<groupId>be.simplenotes</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>simplenotes-types</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlinx</groupId>
|
||||
<artifactId>kotlinx-serialization-json-jvm</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,47 @@
|
||||
package be.simplenotes.types
|
||||
|
||||
import kotlinx.serialization.Contextual
|
||||
import kotlinx.serialization.Serializable
|
||||
import java.time.LocalDateTime
|
||||
import java.util.*
|
||||
|
||||
@Serializable
|
||||
data class NoteMetadata(
|
||||
val title: String,
|
||||
val tags: List<String>,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class PersistedNoteMetadata(
|
||||
val title: String,
|
||||
val tags: List<String>,
|
||||
@Contextual val updatedAt: LocalDateTime,
|
||||
@Contextual val uuid: UUID,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class Note(
|
||||
val meta: NoteMetadata,
|
||||
val markdown: String,
|
||||
val html: String,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class PersistedNote(
|
||||
val meta: NoteMetadata,
|
||||
val markdown: String,
|
||||
val html: String,
|
||||
@Contextual val updatedAt: LocalDateTime,
|
||||
@Contextual val uuid: UUID,
|
||||
val public: Boolean,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class ExportedNote(
|
||||
val title: String,
|
||||
val tags: List<String>,
|
||||
val markdown: String,
|
||||
val html: String,
|
||||
@Contextual val updatedAt: LocalDateTime,
|
||||
val trash: Boolean,
|
||||
)
|
||||
@@ -0,0 +1,4 @@
|
||||
package be.simplenotes.types
|
||||
|
||||
data class User(val username: String, val password: String)
|
||||
data class PersistedUser(val username: String, val password: String, val id: Int)
|
||||
Reference in New Issue
Block a user