From 55af96bd6c5e975044780bd9eff7031ac79e48c9 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Thu, 21 Dec 2023 18:35:53 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=B5=B5=E6=96=87=E5=AD=97=E3=81=AE?= =?UTF-8?q?=E3=82=A8=E3=83=B3=E3=83=86=E3=82=A3=E3=83=86=E3=82=A3=E3=81=A8?= =?UTF-8?q?Repository=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/domain/model/emoji/CustomEmoji.kt | 24 +++++++++++++++++++ .../model/emoji/CustomEmojiRepository.kt | 7 ++++++ 2 files changed, 31 insertions(+) create mode 100644 src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmoji.kt create mode 100644 src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmojiRepository.kt diff --git a/src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmoji.kt b/src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmoji.kt new file mode 100644 index 00000000..f4e69e54 --- /dev/null +++ b/src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmoji.kt @@ -0,0 +1,24 @@ +package dev.usbharu.hideout.core.domain.model.emoji + +import java.time.Instant + +sealed class Emoji { + abstract val domain: String + abstract val name: String +} + +data class CustomEmoji( + val id: Long, + override val name: String, + override val domain: String, + val instanceId: Long, + val url: String, + val category: String, + val createdAt: Instant +) : Emoji() + +data class UnicodeEmoji( + override val name: String +) : Emoji() { + override val domain: String = "unicode.org" +} diff --git a/src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmojiRepository.kt b/src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmojiRepository.kt new file mode 100644 index 00000000..59aa34aa --- /dev/null +++ b/src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmojiRepository.kt @@ -0,0 +1,7 @@ +package dev.usbharu.hideout.core.domain.model.emoji + +interface CustomEmojiRepository { + suspend fun save(customEmoji: CustomEmoji): CustomEmoji + suspend fun findById(id: Long): CustomEmoji? + suspend fun delete(customEmoji: CustomEmoji) +}