mirror of
https://github.com/usbharu/Hideout.git
synced 2026-09-26 15:01:09 +00:00
style: fix lint
This commit is contained in:
@@ -92,7 +92,6 @@ import java.security.interfaces.RSAPrivateKey
|
||||
import java.security.interfaces.RSAPublicKey
|
||||
import java.util.*
|
||||
|
||||
|
||||
@EnableWebSecurity(debug = false)
|
||||
@Configuration
|
||||
@Suppress("FunctionMaxLength", "TooManyFunctions", "LongMethod")
|
||||
|
||||
@@ -35,4 +35,4 @@ open class ClientException : MastodonApiException {
|
||||
writableStackTrace: Boolean,
|
||||
response: MastodonApiErrorResponse<*>,
|
||||
) : super(message, cause, enableSuppression, writableStackTrace, response)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -52,4 +52,4 @@ abstract class MastodonApiException : RuntimeException {
|
||||
) {
|
||||
this.response = response
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ package dev.usbharu.hideout.mastodon.domain.exception
|
||||
|
||||
import dev.usbharu.hideout.mastodon.domain.model.MastodonApiErrorResponse
|
||||
|
||||
open class ServerException(response: MastodonApiErrorResponse<*>) : MastodonApiException(response)
|
||||
open class ServerException(response: MastodonApiErrorResponse<*>) : MastodonApiException(response)
|
||||
|
||||
+8
-7
@@ -21,19 +21,16 @@ import dev.usbharu.hideout.mastodon.domain.model.MastodonApiErrorResponse
|
||||
|
||||
class StatusNotFoundException : ClientException {
|
||||
|
||||
fun getTypedResponse(): MastodonApiErrorResponse<NotFoundResponse> {
|
||||
return response as MastodonApiErrorResponse<NotFoundResponse>
|
||||
}
|
||||
|
||||
constructor(response: MastodonApiErrorResponse<NotFoundResponse>) : super(response)
|
||||
|
||||
constructor(message: String?, response: MastodonApiErrorResponse<NotFoundResponse>) : super(message, response)
|
||||
constructor(message: String?, cause: Throwable?, response: MastodonApiErrorResponse<NotFoundResponse>) : super(
|
||||
message,
|
||||
cause,
|
||||
response
|
||||
)
|
||||
|
||||
constructor(cause: Throwable?, response: MastodonApiErrorResponse<NotFoundResponse>) : super(cause, response)
|
||||
|
||||
constructor(
|
||||
message: String?,
|
||||
cause: Throwable?,
|
||||
@@ -42,14 +39,18 @@ class StatusNotFoundException : ClientException {
|
||||
response: MastodonApiErrorResponse<NotFoundResponse>,
|
||||
) : super(message, cause, enableSuppression, writableStackTrace, response)
|
||||
|
||||
fun getTypedResponse(): MastodonApiErrorResponse<NotFoundResponse> =
|
||||
response as MastodonApiErrorResponse<NotFoundResponse>
|
||||
|
||||
companion object {
|
||||
fun ofId(id: Long): StatusNotFoundException = StatusNotFoundException(
|
||||
"id: $id was not found.",
|
||||
MastodonApiErrorResponse(
|
||||
NotFoundResponse(
|
||||
"Record not found"
|
||||
), 404
|
||||
),
|
||||
404
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,4 +16,4 @@
|
||||
|
||||
package dev.usbharu.hideout.mastodon.domain.model
|
||||
|
||||
data class MastodonApiErrorResponse<R>(val response: R, val statusCode: Int)
|
||||
data class MastodonApiErrorResponse<R>(val response: R, val statusCode: Int)
|
||||
|
||||
+2
-2
@@ -85,7 +85,7 @@ class MastodonApiControllerAdvice {
|
||||
}
|
||||
|
||||
val message = details.map {
|
||||
it.key + " " + it.value.joinToString { it.description }
|
||||
it.key + " " + it.value.joinToString { responseDetails -> responseDetails.description }
|
||||
}.joinToString()
|
||||
|
||||
return ResponseEntity.unprocessableEntity()
|
||||
@@ -101,4 +101,4 @@ class MastodonApiControllerAdvice {
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(MastodonApiControllerAdvice::class.java)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -43,7 +43,6 @@ class MastodonStatusesApiContoller(
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
override suspend fun apiV1StatusesIdEmojiReactionsEmojiDelete(id: String, emoji: String): ResponseEntity<Status> {
|
||||
val uid =
|
||||
loginUserContextHolder.getLoginUserId()
|
||||
|
||||
@@ -161,8 +161,6 @@ class StatsesApiServiceImpl(
|
||||
status: Status,
|
||||
userId: Long?,
|
||||
): Status {
|
||||
|
||||
|
||||
return when (status.visibility) {
|
||||
public -> status
|
||||
unlisted -> status
|
||||
|
||||
Reference in New Issue
Block a user