refactor: 予約語を使っていたパッケージ名を修正

This commit is contained in:
usbharu 2023-11-01 14:10:59 +09:00
parent 570895bfdd
commit 5586a61298
43 changed files with 59 additions and 65 deletions

View File

@ -47,6 +47,9 @@ style:
UseRequire:
active: false
VarCouldBeVal:
ignoreLateinitVar: true
complexity:
CognitiveComplexMethod:
active: true

View File

@ -1,8 +1,8 @@
package dev.usbharu.hideout.activitypub.domain.model
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.`object`.ObjectDeserializer
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectDeserializer
open class Accept : Object {
@JsonDeserialize(using = ObjectDeserializer::class)

View File

@ -1,8 +1,8 @@
package dev.usbharu.hideout.activitypub.domain.model
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.`object`.ObjectDeserializer
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectDeserializer
open class Create : Object {
@JsonDeserialize(using = ObjectDeserializer::class)

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.domain.model
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
open class Document : Object {

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.domain.model
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
open class Emoji : Object {
var updated: String? = null

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.domain.model
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
open class Follow : Object {
var `object`: String? = null

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.domain.model
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
open class Image : Object {
private var mediaType: String? = null

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.domain.model
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
open class Key : Object {
var owner: String? = null

View File

@ -1,8 +1,8 @@
package dev.usbharu.hideout.activitypub.domain.model
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.`object`.ObjectDeserializer
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectDeserializer
open class Like : Object {
var `object`: String? = null

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.domain.model
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
open class Note : Object {
var attributedTo: String? = null

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.domain.model
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
open class Person : Object {
var preferredUsername: String? = null

View File

@ -1,8 +1,8 @@
package dev.usbharu.hideout.activitypub.domain.model
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.`object`.ObjectDeserializer
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectDeserializer
import java.time.Instant
open class Undo : Object {

View File

@ -1,4 +1,4 @@
package dev.usbharu.hideout.activitypub.domain.model.`object`
package dev.usbharu.hideout.activitypub.domain.model.objects
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.JsonSerializer

View File

@ -1,4 +1,4 @@
package dev.usbharu.hideout.activitypub.domain.model.`object`
package dev.usbharu.hideout.activitypub.domain.model.objects
import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.databind.DeserializationContext

View File

@ -1,4 +1,4 @@
package dev.usbharu.hideout.activitypub.domain.model.`object`
package dev.usbharu.hideout.activitypub.domain.model.objects
open class ObjectValue : Object {

View File

@ -3,7 +3,7 @@ package dev.usbharu.hideout.activitypub.infrastructure.exposedquery
import dev.usbharu.hideout.activitypub.domain.model.Document
import dev.usbharu.hideout.activitypub.domain.model.Note
import dev.usbharu.hideout.activitypub.query.NoteQueryService
import dev.usbharu.hideout.activitypub.service.`object`.note.APNoteServiceImpl.Companion.public
import dev.usbharu.hideout.activitypub.service.objects.note.APNoteServiceImpl.Companion.public
import dev.usbharu.hideout.application.infrastructure.exposed.QueryMapper
import dev.usbharu.hideout.core.domain.model.post.Post
import dev.usbharu.hideout.core.domain.model.post.PostRepository

View File

@ -1,7 +1,7 @@
package dev.usbharu.hideout.activitypub.interfaces.api.actor
import dev.usbharu.hideout.activitypub.domain.model.Person
import dev.usbharu.hideout.activitypub.service.`object`.user.APUserService
import dev.usbharu.hideout.activitypub.service.objects.user.APUserService
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.RestController

View File

@ -25,9 +25,7 @@ sealed class ActivityPubResponse(
return result
}
override fun toString(): String {
return "ActivityPubResponse(httpStatusCode=$httpStatusCode, contentType=$contentType)"
}
override fun toString(): String = "ActivityPubResponse(httpStatusCode=$httpStatusCode, contentType=$contentType)"
}
class ActivityPubStringResponse(
@ -45,13 +43,9 @@ class ActivityPubStringResponse(
return true
}
override fun hashCode(): Int {
return message.hashCode()
}
override fun hashCode(): Int = message.hashCode()
override fun toString(): String {
return "ActivityPubStringResponse(message='$message') ${super.toString()}"
}
override fun toString(): String = "ActivityPubStringResponse(message='$message') ${super.toString()}"
}
class ActivityPubObjectResponse(
@ -68,11 +62,7 @@ class ActivityPubObjectResponse(
return true
}
override fun hashCode(): Int {
return message.hashCode()
}
override fun hashCode(): Int = message.hashCode()
override fun toString(): String {
return "ActivityPubObjectResponse(message=$message) ${super.toString()}"
}
override fun toString(): String = "ActivityPubObjectResponse(message=$message) ${super.toString()}"
}

View File

@ -1,7 +1,7 @@
package dev.usbharu.hideout.activitypub.interfaces.api.note
import dev.usbharu.hideout.activitypub.domain.model.Note
import dev.usbharu.hideout.activitypub.service.`object`.note.NoteApApiService
import dev.usbharu.hideout.activitypub.service.objects.note.NoteApApiService
import dev.usbharu.hideout.core.infrastructure.springframework.httpsignature.HttpSignatureUser
import org.springframework.http.ResponseEntity
import org.springframework.security.core.annotation.CurrentSecurityContext

View File

@ -5,7 +5,7 @@ import dev.usbharu.hideout.activitypub.domain.model.Create
import dev.usbharu.hideout.activitypub.domain.model.Note
import dev.usbharu.hideout.activitypub.interfaces.api.common.ActivityPubResponse
import dev.usbharu.hideout.activitypub.interfaces.api.common.ActivityPubStringResponse
import dev.usbharu.hideout.activitypub.service.`object`.note.APNoteService
import dev.usbharu.hideout.activitypub.service.objects.note.APNoteService
import dev.usbharu.hideout.application.external.Transaction
import io.ktor.http.*
import org.slf4j.LoggerFactory

View File

@ -5,7 +5,7 @@ import com.fasterxml.jackson.module.kotlin.readValue
import dev.usbharu.hideout.activitypub.domain.model.Accept
import dev.usbharu.hideout.activitypub.domain.model.Follow
import dev.usbharu.hideout.activitypub.service.common.APRequestService
import dev.usbharu.hideout.activitypub.service.`object`.user.APUserService
import dev.usbharu.hideout.activitypub.service.objects.user.APUserService
import dev.usbharu.hideout.application.external.Transaction
import dev.usbharu.hideout.core.external.job.ReceiveFollowJob
import dev.usbharu.hideout.core.query.UserQueryService

View File

@ -5,8 +5,8 @@ import dev.usbharu.hideout.activitypub.domain.exception.IllegalActivityPubObject
import dev.usbharu.hideout.activitypub.domain.model.Like
import dev.usbharu.hideout.activitypub.interfaces.api.common.ActivityPubResponse
import dev.usbharu.hideout.activitypub.interfaces.api.common.ActivityPubStringResponse
import dev.usbharu.hideout.activitypub.service.`object`.note.APNoteService
import dev.usbharu.hideout.activitypub.service.`object`.user.APUserService
import dev.usbharu.hideout.activitypub.service.objects.note.APNoteService
import dev.usbharu.hideout.activitypub.service.objects.user.APUserService
import dev.usbharu.hideout.application.external.Transaction
import dev.usbharu.hideout.core.query.PostQueryService
import dev.usbharu.hideout.core.service.reaction.ReactionService

View File

@ -4,7 +4,7 @@ import dev.usbharu.hideout.activitypub.domain.model.Follow
import dev.usbharu.hideout.activitypub.domain.model.Undo
import dev.usbharu.hideout.activitypub.interfaces.api.common.ActivityPubResponse
import dev.usbharu.hideout.activitypub.interfaces.api.common.ActivityPubStringResponse
import dev.usbharu.hideout.activitypub.service.`object`.user.APUserService
import dev.usbharu.hideout.activitypub.service.objects.user.APUserService
import dev.usbharu.hideout.application.external.Transaction
import dev.usbharu.hideout.core.query.UserQueryService
import dev.usbharu.hideout.core.service.user.UserService

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.service.common
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
import dev.usbharu.hideout.core.domain.model.user.User
interface APRequestService {

View File

@ -1,7 +1,7 @@
package dev.usbharu.hideout.activitypub.service.common
import com.fasterxml.jackson.databind.ObjectMapper
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
import dev.usbharu.hideout.core.domain.model.user.User
import dev.usbharu.hideout.util.Base64Util
import dev.usbharu.hideout.util.HttpUtil.Activity

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.service.common
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
import dev.usbharu.hideout.core.domain.model.user.User
interface APResourceResolveService {

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.service.common
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
import dev.usbharu.hideout.core.domain.model.user.User
import dev.usbharu.hideout.core.domain.model.user.UserRepository
import org.springframework.stereotype.Service

View File

@ -2,7 +2,7 @@ package dev.usbharu.hideout.activitypub.service.common
import dev.usbharu.hideout.activitypub.service.activity.follow.APReceiveFollowJobService
import dev.usbharu.hideout.activitypub.service.activity.like.ApReactionJobService
import dev.usbharu.hideout.activitypub.service.`object`.note.ApNoteJobService
import dev.usbharu.hideout.activitypub.service.objects.note.ApNoteJobService
import dev.usbharu.hideout.core.external.job.*
import kjob.core.dsl.JobContextWithProps
import kjob.core.job.JobProps

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.service.common
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
interface CacheManager {

View File

@ -1,6 +1,6 @@
package dev.usbharu.hideout.activitypub.service.common
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
import dev.usbharu.hideout.util.LruCache
import kotlinx.coroutines.delay
import kotlinx.coroutines.sync.Mutex

View File

@ -1,4 +1,4 @@
package dev.usbharu.hideout.activitypub.service.`object`.note
package dev.usbharu.hideout.activitypub.service.objects.note
import com.fasterxml.jackson.databind.ObjectMapper
import dev.usbharu.hideout.activitypub.domain.exception.FailedToGetActivityPubResourceException
@ -6,7 +6,7 @@ import dev.usbharu.hideout.activitypub.domain.exception.IllegalActivityPubObject
import dev.usbharu.hideout.activitypub.domain.model.Note
import dev.usbharu.hideout.activitypub.service.common.APResourceResolveService
import dev.usbharu.hideout.activitypub.service.common.resolve
import dev.usbharu.hideout.activitypub.service.`object`.user.APUserService
import dev.usbharu.hideout.activitypub.service.objects.user.APUserService
import dev.usbharu.hideout.core.domain.exception.FailedToGetResourcesException
import dev.usbharu.hideout.core.domain.model.post.Post
import dev.usbharu.hideout.core.domain.model.post.PostRepository

View File

@ -1,4 +1,4 @@
package dev.usbharu.hideout.activitypub.service.`object`.note
package dev.usbharu.hideout.activitypub.service.objects.note
import dev.usbharu.hideout.core.external.job.DeliverPostJob
import kjob.core.job.JobProps

View File

@ -1,4 +1,4 @@
package dev.usbharu.hideout.activitypub.service.`object`.note
package dev.usbharu.hideout.activitypub.service.objects.note
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue

View File

@ -1,4 +1,4 @@
package dev.usbharu.hideout.activitypub.service.`object`.note
package dev.usbharu.hideout.activitypub.service.objects.note
import dev.usbharu.hideout.activitypub.domain.model.Note

View File

@ -1,4 +1,4 @@
package dev.usbharu.hideout.activitypub.service.`object`.note
package dev.usbharu.hideout.activitypub.service.objects.note
import dev.usbharu.hideout.activitypub.domain.model.Note
import dev.usbharu.hideout.activitypub.query.NoteQueryService

View File

@ -1,4 +1,4 @@
package dev.usbharu.hideout.activitypub.service.`object`.user
package dev.usbharu.hideout.activitypub.service.objects.user
import dev.usbharu.hideout.activitypub.domain.exception.IllegalActivityPubObjectException
import dev.usbharu.hideout.activitypub.domain.model.Image

View File

@ -25,7 +25,8 @@ class MediaServiceImpl(
) : MediaService {
override suspend fun uploadLocalMedia(mediaRequest: MediaRequest): EntityMedia {
logger.info(
"Media upload. filename:${mediaRequest.file.name} size:${mediaRequest.file.size} contentType:${mediaRequest.file.contentType}"
"Media upload. filename:${mediaRequest.file.name} size:${mediaRequest.file.size} " +
"contentType:${mediaRequest.file.contentType}"
)
if (mediaRequest.file.size == 0L) {

View File

@ -5,7 +5,7 @@ import dev.usbharu.hideout.activitypub.domain.model.Create
import dev.usbharu.hideout.activitypub.domain.model.Like
import dev.usbharu.hideout.activitypub.domain.model.Note
import dev.usbharu.hideout.activitypub.interfaces.api.common.ActivityPubStringResponse
import dev.usbharu.hideout.activitypub.service.`object`.note.APNoteService
import dev.usbharu.hideout.activitypub.service.objects.note.APNoteService
import io.ktor.http.*
import kotlinx.coroutines.test.runTest
import org.junit.jupiter.api.Assertions.assertEquals

View File

@ -7,7 +7,7 @@ import dev.usbharu.hideout.activitypub.domain.model.Follow
import dev.usbharu.hideout.activitypub.domain.model.Image
import dev.usbharu.hideout.activitypub.domain.model.Key
import dev.usbharu.hideout.activitypub.domain.model.Person
import dev.usbharu.hideout.activitypub.service.`object`.user.APUserService
import dev.usbharu.hideout.activitypub.service.objects.user.APUserService
import dev.usbharu.hideout.application.config.ApplicationConfig
import dev.usbharu.hideout.application.config.CharacterLimit
import dev.usbharu.hideout.core.domain.model.post.Post

View File

@ -5,8 +5,8 @@ import dev.usbharu.hideout.activitypub.domain.model.Like
import dev.usbharu.hideout.activitypub.domain.model.Note
import dev.usbharu.hideout.activitypub.domain.model.Person
import dev.usbharu.hideout.activitypub.interfaces.api.common.ActivityPubStringResponse
import dev.usbharu.hideout.activitypub.service.`object`.note.APNoteService
import dev.usbharu.hideout.activitypub.service.`object`.user.APUserService
import dev.usbharu.hideout.activitypub.service.objects.note.APNoteService
import dev.usbharu.hideout.activitypub.service.objects.user.APUserService
import dev.usbharu.hideout.core.query.PostQueryService
import dev.usbharu.hideout.core.service.reaction.ReactionService
import io.ktor.http.*

View File

@ -9,7 +9,7 @@ import org.junit.jupiter.api.extension.ExtendWith
import org.mockito.junit.jupiter.MockitoExtension
import org.mockito.kotlin.*
import utils.UserBuilder
import dev.usbharu.hideout.activitypub.domain.model.`object`.Object as APObject
import dev.usbharu.hideout.activitypub.domain.model.objects.Object as APObject
@ExtendWith(MockitoExtension::class)

View File

@ -1,6 +1,6 @@
@file:OptIn(ExperimentalCoroutinesApi::class) @file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package dev.usbharu.hideout.activitypub.service.`object`.note
package dev.usbharu.hideout.activitypub.service.objects.note
import dev.usbharu.hideout.activitypub.domain.exception.FailedToGetActivityPubResourceException
import dev.usbharu.hideout.activitypub.domain.model.Image
@ -8,8 +8,8 @@ import dev.usbharu.hideout.activitypub.domain.model.Key
import dev.usbharu.hideout.activitypub.domain.model.Note
import dev.usbharu.hideout.activitypub.domain.model.Person
import dev.usbharu.hideout.activitypub.service.common.APResourceResolveService
import dev.usbharu.hideout.activitypub.service.`object`.note.APNoteServiceImpl.Companion.public
import dev.usbharu.hideout.activitypub.service.`object`.user.APUserService
import dev.usbharu.hideout.activitypub.service.objects.note.APNoteServiceImpl.Companion.public
import dev.usbharu.hideout.activitypub.service.objects.user.APUserService
import dev.usbharu.hideout.application.config.ApplicationConfig
import dev.usbharu.hideout.application.config.CharacterLimit
import dev.usbharu.hideout.application.service.id.TwitterSnowflakeIdGenerateService

View File

@ -1,6 +1,6 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package dev.usbharu.hideout.activitypub.service.`object`.note
package dev.usbharu.hideout.activitypub.service.objects.note
import dev.usbharu.hideout.activitypub.domain.model.Create
import dev.usbharu.hideout.activitypub.domain.model.Note