From a99f7036fa25a8445175de54c9e69162fcbadda4 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Mon, 8 May 2023 11:48:27 +0900 Subject: [PATCH] =?UTF-8?q?style:=20=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB?= =?UTF-8?q?=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/hideout/dto/PostCreateDto.kt | 2 +- .../hideout/domain/model/hideout/entity/Post.kt | 14 +++++++------- .../hideout/domain/model/hideout/form/Post.kt | 2 +- .../kotlin/dev/usbharu/hideout/plugins/Security.kt | 2 +- .../hideout/repository/PostRepositoryImpl.kt | 1 - 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/dto/PostCreateDto.kt b/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/dto/PostCreateDto.kt index f23c1dc8..d863489a 100644 --- a/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/dto/PostCreateDto.kt +++ b/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/dto/PostCreateDto.kt @@ -1,3 +1,3 @@ package dev.usbharu.hideout.domain.model.hideout.dto -data class PostCreateDto(val text:String,val username:String) +data class PostCreateDto(val text: String, val username: String) diff --git a/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/entity/Post.kt b/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/entity/Post.kt index 423009cf..2cfb45be 100644 --- a/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/entity/Post.kt +++ b/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/entity/Post.kt @@ -1,13 +1,13 @@ package dev.usbharu.hideout.domain.model.hideout.entity data class Post( - val id:Long, + val id: Long, val userId: Long, - val overview:String? = null, - val text:String, - val createdAt:Long, + val overview: String? = null, + val text: String, + val createdAt: Long, val visibility: Visibility, - val url:String, - val repostId:Long? = null, - val replyId:Long? = null + val url: String, + val repostId: Long? = null, + val replyId: Long? = null ) diff --git a/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/form/Post.kt b/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/form/Post.kt index 99014e88..7e654ab2 100644 --- a/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/form/Post.kt +++ b/src/main/kotlin/dev/usbharu/hideout/domain/model/hideout/form/Post.kt @@ -1,3 +1,3 @@ package dev.usbharu.hideout.domain.model.hideout.form -data class Post(val text:String) +data class Post(val text: String) diff --git a/src/main/kotlin/dev/usbharu/hideout/plugins/Security.kt b/src/main/kotlin/dev/usbharu/hideout/plugins/Security.kt index afb89c1e..bf5c95f2 100644 --- a/src/main/kotlin/dev/usbharu/hideout/plugins/Security.kt +++ b/src/main/kotlin/dev/usbharu/hideout/plugins/Security.kt @@ -39,7 +39,7 @@ fun Application.configureSecurity( if (uid.isMissing) { return@validate null } - if (uid.asLong() == null) { + if (uid.asLong() == null) { return@validate null } return@validate JWTPrincipal(jwtCredential.payload) diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt index 9f679901..45101190 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt @@ -25,7 +25,6 @@ class PostRepositoryImpl(database: Database, private val idGenerateService: IdGe suspend fun query(block: suspend () -> T): T = newSuspendedTransaction(Dispatchers.IO) { block() } - override suspend fun save(post: Post): Post { return query { Posts.insert {