From 86626a6046445f3d75e446b3c586b15bc8c885a2 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:48:00 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E5=8B=95=E7=94=9F=E6=88=90?= =?UTF-8?q?=E3=81=8C=E6=B6=88=E3=81=88=E3=81=A6=E3=81=84=E3=81=9F=E9=83=A8?= =?UTF-8?q?=E5=88=86=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/model/mastodon/StatusesRequest.kt | 22 ++++++++++++++----- .../api/mastodon/StatusesApiService.kt | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/domain/model/mastodon/StatusesRequest.kt b/src/main/kotlin/dev/usbharu/hideout/domain/model/mastodon/StatusesRequest.kt index b8c8d2f1..d82a8bad 100644 --- a/src/main/kotlin/dev/usbharu/hideout/domain/model/mastodon/StatusesRequest.kt +++ b/src/main/kotlin/dev/usbharu/hideout/domain/model/mastodon/StatusesRequest.kt @@ -1,31 +1,38 @@ package dev.usbharu.hideout.domain.model.mastodon import com.fasterxml.jackson.annotation.JsonProperty -import dev.usbharu.hideout.domain.mastodon.model.generated.StatusesRequest import dev.usbharu.hideout.domain.mastodon.model.generated.StatusesRequestPoll class StatusesRequest { @JsonProperty("status") var status: String? = null + @JsonProperty("media_ids") var media_ids: List = emptyList() + @JsonProperty("poll") var poll: StatusesRequestPoll? = null + @JsonProperty("in_reply_to_id") var in_reply_to_id: String? = null + @JsonProperty("sensitive") var sensitive: Boolean? = null + @JsonProperty("spoiler_text") var spoiler_text: String? = null + @JsonProperty("visibility") - var visibility: StatusesRequest.Visibility? = null + var visibility: Visibility? = null + @JsonProperty("language") var language: String? = null + @JsonProperty("scheduled_at") var scheduled_at: String? = null override fun equals(other: Any?): Boolean { if (this === other) return true - if (other !is dev.usbharu.hideout.domain.model.mastodon.StatusesRequest) return false + if (other !is StatusesRequest) return false if (status != other.status) return false if (media_ids != other.media_ids) return false @@ -40,7 +47,6 @@ class StatusesRequest { return true } - override fun hashCode(): Int { var result = status?.hashCode() ?: 0 result = 31 * result + media_ids.hashCode() @@ -54,9 +60,15 @@ class StatusesRequest { return result } + override fun toString(): String { return "StatusesRequest(status=$status, mediaIds=$media_ids, poll=$poll, inReplyToId=$in_reply_to_id, sensitive=$sensitive, spoilerText=$spoiler_text, visibility=$visibility, language=$language, scheduledAt=$scheduled_at)" } - + enum class Visibility { + `public`, + unlisted, + private, + direct; + } } diff --git a/src/main/kotlin/dev/usbharu/hideout/service/api/mastodon/StatusesApiService.kt b/src/main/kotlin/dev/usbharu/hideout/service/api/mastodon/StatusesApiService.kt index 984097b6..93d1634f 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/api/mastodon/StatusesApiService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/api/mastodon/StatusesApiService.kt @@ -2,10 +2,10 @@ package dev.usbharu.hideout.service.api.mastodon import dev.usbharu.hideout.domain.mastodon.model.generated.MediaAttachment import dev.usbharu.hideout.domain.mastodon.model.generated.Status -import dev.usbharu.hideout.domain.mastodon.model.generated.StatusesRequest import dev.usbharu.hideout.domain.model.hideout.dto.FileType import dev.usbharu.hideout.domain.model.hideout.dto.PostCreateDto import dev.usbharu.hideout.domain.model.hideout.entity.Visibility +import dev.usbharu.hideout.domain.model.mastodon.StatusesRequest import dev.usbharu.hideout.exception.FailedToGetResourcesException import dev.usbharu.hideout.query.PostQueryService import dev.usbharu.hideout.query.UserQueryService