style: fix lint

This commit is contained in:
usbharu 2024-02-24 14:25:59 +09:00
parent 5c8d7e8d36
commit 23c830f390
9 changed files with 14 additions and 17 deletions

View File

@ -92,7 +92,6 @@ import java.security.interfaces.RSAPrivateKey
import java.security.interfaces.RSAPublicKey import java.security.interfaces.RSAPublicKey
import java.util.* import java.util.*
@EnableWebSecurity(debug = false) @EnableWebSecurity(debug = false)
@Configuration @Configuration
@Suppress("FunctionMaxLength", "TooManyFunctions", "LongMethod") @Suppress("FunctionMaxLength", "TooManyFunctions", "LongMethod")

View File

@ -21,19 +21,16 @@ import dev.usbharu.hideout.mastodon.domain.model.MastodonApiErrorResponse
class StatusNotFoundException : ClientException { class StatusNotFoundException : ClientException {
fun getTypedResponse(): MastodonApiErrorResponse<NotFoundResponse> {
return response as MastodonApiErrorResponse<NotFoundResponse>
}
constructor(response: MastodonApiErrorResponse<NotFoundResponse>) : super(response) constructor(response: MastodonApiErrorResponse<NotFoundResponse>) : super(response)
constructor(message: String?, response: MastodonApiErrorResponse<NotFoundResponse>) : super(message, response) constructor(message: String?, response: MastodonApiErrorResponse<NotFoundResponse>) : super(message, response)
constructor(message: String?, cause: Throwable?, response: MastodonApiErrorResponse<NotFoundResponse>) : super( constructor(message: String?, cause: Throwable?, response: MastodonApiErrorResponse<NotFoundResponse>) : super(
message, message,
cause, cause,
response response
) )
constructor(cause: Throwable?, response: MastodonApiErrorResponse<NotFoundResponse>) : super(cause, response) constructor(cause: Throwable?, response: MastodonApiErrorResponse<NotFoundResponse>) : super(cause, response)
constructor( constructor(
message: String?, message: String?,
cause: Throwable?, cause: Throwable?,
@ -42,13 +39,17 @@ class StatusNotFoundException : ClientException {
response: MastodonApiErrorResponse<NotFoundResponse>, response: MastodonApiErrorResponse<NotFoundResponse>,
) : super(message, cause, enableSuppression, writableStackTrace, response) ) : super(message, cause, enableSuppression, writableStackTrace, response)
fun getTypedResponse(): MastodonApiErrorResponse<NotFoundResponse> =
response as MastodonApiErrorResponse<NotFoundResponse>
companion object { companion object {
fun ofId(id: Long): StatusNotFoundException = StatusNotFoundException( fun ofId(id: Long): StatusNotFoundException = StatusNotFoundException(
"id: $id was not found.", "id: $id was not found.",
MastodonApiErrorResponse( MastodonApiErrorResponse(
NotFoundResponse( NotFoundResponse(
"Record not found" "Record not found"
), 404 ),
404
), ),
) )
} }

View File

@ -85,7 +85,7 @@ class MastodonApiControllerAdvice {
} }
val message = details.map { val message = details.map {
it.key + " " + it.value.joinToString { it.description } it.key + " " + it.value.joinToString { responseDetails -> responseDetails.description }
}.joinToString() }.joinToString()
return ResponseEntity.unprocessableEntity() return ResponseEntity.unprocessableEntity()

View File

@ -43,7 +43,6 @@ class MastodonStatusesApiContoller(
) )
} }
override suspend fun apiV1StatusesIdEmojiReactionsEmojiDelete(id: String, emoji: String): ResponseEntity<Status> { override suspend fun apiV1StatusesIdEmojiReactionsEmojiDelete(id: String, emoji: String): ResponseEntity<Status> {
val uid = val uid =
loginUserContextHolder.getLoginUserId() loginUserContextHolder.getLoginUserId()

View File

@ -161,8 +161,6 @@ class StatsesApiServiceImpl(
status: Status, status: Status,
userId: Long?, userId: Long?,
): Status { ): Status {
return when (status.visibility) { return when (status.visibility) {
public -> status public -> status
unlisted -> status unlisted -> status