mirror of https://github.com/usbharu/Hideout.git
style: スタイルを修正
This commit is contained in:
parent
7b65458b2f
commit
f3dd22caa9
|
@ -56,16 +56,15 @@ import java.util.*
|
||||||
|
|
||||||
@EnableWebSecurity(debug = false)
|
@EnableWebSecurity(debug = false)
|
||||||
@Configuration
|
@Configuration
|
||||||
@Suppress("FunctionMaxLength")
|
@Suppress("FunctionMaxLength", "TooManyFunctions")
|
||||||
class SecurityConfig {
|
class SecurityConfig {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private lateinit var userQueryService: UserQueryService
|
private lateinit var userQueryService: UserQueryService
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun authenticationManager(authenticationConfiguration: AuthenticationConfiguration): AuthenticationManager? {
|
fun authenticationManager(authenticationConfiguration: AuthenticationConfiguration): AuthenticationManager? =
|
||||||
return authenticationConfiguration.authenticationManager
|
authenticationConfiguration.authenticationManager
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@Order(1)
|
@Order(1)
|
||||||
|
|
|
@ -15,7 +15,6 @@ class MastodonStatusesApiContoller(private val statusesApiService: StatusesApiSe
|
||||||
override suspend fun apiV1StatusesPost(
|
override suspend fun apiV1StatusesPost(
|
||||||
devUsbharuHideoutDomainModelMastodonStatusesRequest: StatusesRequest
|
devUsbharuHideoutDomainModelMastodonStatusesRequest: StatusesRequest
|
||||||
): ResponseEntity<Status> {
|
): ResponseEntity<Status> {
|
||||||
|
|
||||||
val jwt = SecurityContextHolder.getContext().authentication.principal as Jwt
|
val jwt = SecurityContextHolder.getContext().authentication.principal as Jwt
|
||||||
|
|
||||||
return ResponseEntity(
|
return ResponseEntity(
|
||||||
|
@ -25,6 +24,5 @@ class MastodonStatusesApiContoller(private val statusesApiService: StatusesApiSe
|
||||||
),
|
),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,15 +21,17 @@ data class User private constructor(
|
||||||
val followers: String? = null,
|
val followers: String? = null,
|
||||||
val following: String? = null
|
val following: String? = null
|
||||||
) {
|
) {
|
||||||
override fun toString(): String {
|
override fun toString(): String =
|
||||||
return "User(id=$id, name='$name', domain='$domain', screenName='$screenName', description='$description', password=$password, inbox='$inbox', outbox='$outbox', url='$url', publicKey='$publicKey', privateKey=$privateKey, createdAt=$createdAt, keyId='$keyId', followers=$followers, following=$following)"
|
"User(id=$id, name='$name', domain='$domain', screenName='$screenName', description='$description'," +
|
||||||
}
|
" password=$password, inbox='$inbox', outbox='$outbox', url='$url', publicKey='$publicKey'," +
|
||||||
|
" privateKey=$privateKey, createdAt=$createdAt, keyId='$keyId', followers=$followers," +
|
||||||
|
" following=$following)"
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
private val logger = LoggerFactory.getLogger(User::class.java)
|
private val logger = LoggerFactory.getLogger(User::class.java)
|
||||||
|
|
||||||
@Suppress("LongParameterList", "FunctionMinLength")
|
@Suppress("LongParameterList", "FunctionMinLength", "LongMethod")
|
||||||
fun of(
|
fun of(
|
||||||
id: Long,
|
id: Long,
|
||||||
name: String,
|
name: String,
|
||||||
|
|
|
@ -23,7 +23,6 @@ import dev.usbharu.hideout.service.core.Transaction
|
||||||
import dev.usbharu.hideout.service.job.JobQueueParentService
|
import dev.usbharu.hideout.service.job.JobQueueParentService
|
||||||
import dev.usbharu.hideout.service.post.PostCreateInterceptor
|
import dev.usbharu.hideout.service.post.PostCreateInterceptor
|
||||||
import dev.usbharu.hideout.service.post.PostService
|
import dev.usbharu.hideout.service.post.PostService
|
||||||
import io.ktor.client.*
|
|
||||||
import io.ktor.client.plugins.*
|
import io.ktor.client.plugins.*
|
||||||
import kjob.core.job.JobProps
|
import kjob.core.job.JobProps
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
@ -58,7 +57,6 @@ interface APNoteService {
|
||||||
@Service
|
@Service
|
||||||
@Suppress("LongParameterList")
|
@Suppress("LongParameterList")
|
||||||
class APNoteServiceImpl(
|
class APNoteServiceImpl(
|
||||||
private val httpClient: HttpClient,
|
|
||||||
private val jobQueueParentService: JobQueueParentService,
|
private val jobQueueParentService: JobQueueParentService,
|
||||||
private val postRepository: PostRepository,
|
private val postRepository: PostRepository,
|
||||||
private val apUserService: APUserService,
|
private val apUserService: APUserService,
|
||||||
|
|
|
@ -89,17 +89,16 @@ class APNoteServiceImplTest {
|
||||||
val jobQueueParentService = mock<JobQueueParentService>()
|
val jobQueueParentService = mock<JobQueueParentService>()
|
||||||
val activityPubNoteService =
|
val activityPubNoteService =
|
||||||
APNoteServiceImpl(
|
APNoteServiceImpl(
|
||||||
httpClient = mock(),
|
|
||||||
jobQueueParentService = jobQueueParentService,
|
jobQueueParentService = jobQueueParentService,
|
||||||
postRepository = mock(),
|
postRepository = mock(),
|
||||||
apUserService = mock(),
|
apUserService = mock(),
|
||||||
userQueryService = userQueryService,
|
userQueryService = userQueryService,
|
||||||
followerQueryService = followerQueryService,
|
followerQueryService = followerQueryService,
|
||||||
postQueryService = mock(),
|
postQueryService = mock(),
|
||||||
|
mediaQueryService = mediaQueryService,
|
||||||
objectMapper = objectMapper,
|
objectMapper = objectMapper,
|
||||||
applicationConfig = testApplicationConfig,
|
applicationConfig = testApplicationConfig,
|
||||||
postService = mock(),
|
postService = mock(),
|
||||||
mediaQueryService = mediaQueryService,
|
|
||||||
apResourceResolveService = mock(),
|
apResourceResolveService = mock(),
|
||||||
apRequestService = mock(),
|
apRequestService = mock(),
|
||||||
transaction = mock()
|
transaction = mock()
|
||||||
|
@ -132,20 +131,19 @@ class APNoteServiceImplTest {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
val activityPubNoteService = APNoteServiceImpl(
|
val activityPubNoteService = APNoteServiceImpl(
|
||||||
httpClient = httpClient,
|
|
||||||
jobQueueParentService = mock(),
|
jobQueueParentService = mock(),
|
||||||
postRepository = mock(),
|
postRepository = mock(),
|
||||||
apUserService = mock(),
|
apUserService = mock(),
|
||||||
userQueryService = mock(),
|
userQueryService = mock(),
|
||||||
followerQueryService = mock(),
|
followerQueryService = mock(),
|
||||||
postQueryService = mock(),
|
postQueryService = mock(),
|
||||||
|
mediaQueryService = mediaQueryService,
|
||||||
objectMapper = objectMapper,
|
objectMapper = objectMapper,
|
||||||
applicationConfig = testApplicationConfig,
|
applicationConfig = testApplicationConfig,
|
||||||
postService = mock(),
|
postService = mock(),
|
||||||
mediaQueryService = mediaQueryService,
|
|
||||||
apResourceResolveService = mock(),
|
apResourceResolveService = mock(),
|
||||||
transaction = mock(),
|
apRequestService = mock(),
|
||||||
apRequestService = mock()
|
transaction = mock()
|
||||||
)
|
)
|
||||||
activityPubNoteService.createNoteJob(
|
activityPubNoteService.createNoteJob(
|
||||||
JobProps(
|
JobProps(
|
||||||
|
|
Loading…
Reference in New Issue