diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterLocalUserSetHomeTimelineSubscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterLocalUserSetHomeTimelineSubscriber.kt index 49ed5925..868ec419 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterLocalUserSetHomeTimelineSubscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterLocalUserSetHomeTimelineSubscriber.kt @@ -21,4 +21,4 @@ class RegisterLocalUserSetHomeTimelineSubscriber( } } -//todo userdetailにdomain event付けて createのイベントで反応させる タイムラインを新しく一つ作って userdetailのhometimelineに紐づけて自分自身をtimleine relationshipに入れる \ No newline at end of file +// todo userdetailにdomain event付けて createのイベントで反応させる タイムラインを新しく一つ作って userdetailのhometimelineに紐づけて自分自身をtimleine relationshipに入れる diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterTimelineSetTimelineStoreSubscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterTimelineSetTimelineStoreSubscriber.kt index f1a93dfa..246795c6 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterTimelineSetTimelineStoreSubscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/RegisterTimelineSetTimelineStoreSubscriber.kt @@ -18,4 +18,4 @@ class RegisterTimelineSetTimelineStoreSubscriber( setTimelineToTimelineStoreApplicationService.execute(SetTimleineStore(it.body.getTimelineId()), Anonymous) } } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/UserRegisterHomeTimelineApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/UserRegisterHomeTimelineApplicationService.kt index 6119370b..3caa2ec0 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/UserRegisterHomeTimelineApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/UserRegisterHomeTimelineApplicationService.kt @@ -18,13 +18,15 @@ import org.springframework.stereotype.Component class UserRegisterHomeTimelineApplicationService( private val userDetailRepository: UserDetailRepository, private val timelineRepository: TimelineRepository, - private val idGenerateService: IdGenerateService, transaction: Transaction, + private val idGenerateService: IdGenerateService, + transaction: Transaction, private val timelineRelationshipRepository: TimelineRelationshipRepository ) : AbstractApplicationService(transaction, logger) { override suspend fun internalExecute(command: RegisterHomeTimeline, principal: Principal) { - - val userDetail = (userDetailRepository.findById(UserDetailId(command.userDetailId)) - ?: throw IllegalArgumentException("UserDetail ${command.userDetailId} not found.")) + val userDetail = ( + userDetailRepository.findById(UserDetailId(command.userDetailId)) + ?: throw IllegalArgumentException("UserDetail ${command.userDetailId} not found.") + ) val timeline = Timeline.create( TimelineId(idGenerateService.generateId()), @@ -51,4 +53,4 @@ class UserRegisterHomeTimelineApplicationService( companion object { private val logger = LoggerFactory.getLogger(UserRegisterHomeTimelineApplicationService::class.java) } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/ReadTimelineApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/ReadTimelineApplicationService.kt index 17b9b5ae..88fabe9f 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/ReadTimelineApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/ReadTimelineApplicationService.kt @@ -41,7 +41,6 @@ class ReadTimelineApplicationService( ) val postDetailList = timeline.map { - val reply = if (it.replyPost != null) { PostDetail.of( it.replyPost, @@ -80,4 +79,4 @@ class ReadTimelineApplicationService( companion object { private val logger = LoggerFactory.getLogger(ReadTimelineApplicationService::class.java) } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/SetTimelineToTimelineStoreApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/SetTimelineToTimelineStoreApplicationService.kt index f47fcc0f..139b6b55 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/SetTimelineToTimelineStoreApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/SetTimelineToTimelineStoreApplicationService.kt @@ -15,7 +15,8 @@ class SetTimelineToTimelineStoreApplicationService( private val timelineRepository: TimelineRepository ) : AbstractApplicationService( - transaction, logger + transaction, + logger ) { override suspend fun internalExecute(command: SetTimleineStore, principal: Principal) { val findById = timelineRepository.findById(command.timelineId) @@ -26,4 +27,4 @@ class SetTimelineToTimelineStoreApplicationService( companion object { private val logger = LoggerFactory.getLogger(SetTimelineToTimelineStoreApplicationService::class.java) } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/TimelineAddPostApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/TimelineAddPostApplicationService.kt index 8c907a61..c00b54ef 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/TimelineAddPostApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/TimelineAddPostApplicationService.kt @@ -26,4 +26,4 @@ class TimelineAddPostApplicationService( companion object { private val logger = LoggerFactory.getLogger(TimelineAddPostApplicationService::class.java) } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterTimelineApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterTimelineApplicationService.kt index 0660c020..5b0af07c 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterTimelineApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterTimelineApplicationService.kt @@ -34,4 +34,4 @@ class UserRegisterTimelineApplicationService( companion object { private val logger = LoggerFactory.getLogger(UserRegisterTimelineApplicationService::class.java) } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/userdetail/UserDetailEvent.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/userdetail/UserDetailEvent.kt index 7493e943..792b475c 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/userdetail/UserDetailEvent.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/event/userdetail/UserDetailEvent.kt @@ -26,4 +26,4 @@ class UserDetailEventBody(userDetail: UserDetailId) : DomainEventBody( enum class UserDetailEvent(val eventName: String) { CREATE("UserDetailCreate"), -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt index 97b78c5a..0b82ee76 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt @@ -23,9 +23,9 @@ class DefaultPostReadAccessControl(private val relationshipRepository: Relations } val relationship = ( - relationshipRepository.findByActorIdAndTargetId(post.actorId, principal.actorId) - ?: Relationship.default(post.actorId, principal.actorId) - ) + relationshipRepository.findByActorIdAndTargetId(post.actorId, principal.actorId) + ?: Relationship.default(post.actorId, principal.actorId) + ) // ブロックされてたら見れない if (relationship.blocking) { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt index 7aee838c..76d80efd 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt @@ -63,7 +63,6 @@ class ExposedActorInstanceRelationshipRepository(override val domainEventPublish update(actorInstanceRelationship) } } - } override suspend fun findByActorIdAndInstanceId( diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedPostRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedPostRepository.kt index 357ce015..78dcbbff 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedPostRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedPostRepository.kt @@ -204,7 +204,6 @@ class ExposedPostRepository( update(post) } } - } override suspend fun findByActorIdAndVisibilityInList( diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt index 96ddef0f..73675308 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt @@ -64,7 +64,6 @@ class ExposedRelationshipRepository(override val domainEventPublisher: DomainEve update(relationship) } } - } override suspend fun findByActorIdAndTargetId(actorId: ActorId, targetId: ActorId): Relationship? = query { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRepository.kt index d884bbf1..3bd964f7 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedTimelineRepository.kt @@ -29,7 +29,6 @@ class ExposedTimelineRepository(override val domainEventPublisher: DomainEventPu } } - return timeline } @@ -42,7 +41,6 @@ class ExposedTimelineRepository(override val domainEventPublisher: DomainEventPu update(timeline) } } - } override suspend fun findByIds(ids: List): List { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/UserDetailRepositoryImpl.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/UserDetailRepositoryImpl.kt index a508a07a..1169e109 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/UserDetailRepositoryImpl.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/UserDetailRepositoryImpl.kt @@ -32,8 +32,10 @@ import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository @Repository -class UserDetailRepositoryImpl(override val domainEventPublisher: DomainEventPublisher) : UserDetailRepository, - AbstractRepository(), DomainEventPublishableRepository { +class UserDetailRepositoryImpl(override val domainEventPublisher: DomainEventPublisher) : + UserDetailRepository, + AbstractRepository(), + DomainEventPublishableRepository { override val logger: Logger get() = Companion.logger @@ -68,14 +70,13 @@ class UserDetailRepositoryImpl(override val domainEventPublisher: DomainEventPub return userDetail1 } - override suspend fun delete(userDetail: UserDetail): Unit { + override suspend fun delete(userDetail: UserDetail) { query { UserDetails.deleteWhere { id eq userDetail.id.id } onComplete { update(userDetail) } } - } override suspend fun findByActorId(actorId: Long): UserDetail? = query { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/DefaultTimelineStore.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/DefaultTimelineStore.kt index 182ed506..2a704496 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/DefaultTimelineStore.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/DefaultTimelineStore.kt @@ -156,8 +156,6 @@ open class DefaultTimelineStore( ) } return PaginationList(emptyList(), page?.maxId?.let { PostId(it) }, page?.minId?.let { PostId(it) }) - - } override suspend fun getActors(actorIds: List): Map { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/timeline/TimelineController.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/timeline/TimelineController.kt index 8b6da2ad..fe88f560 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/timeline/TimelineController.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/timeline/TimelineController.kt @@ -45,11 +45,12 @@ class TimelineController( minId = minId?.toLongOrNull(), limit = 20 ) - ), principal + ), + principal ) model.addAttribute("timeline", execute) return "homeTimeline" } -} \ No newline at end of file +}