mirror of https://github.com/usbharu/Hideout.git
style: スタイルを修正
This commit is contained in:
parent
b5739832ef
commit
3bef01a955
|
@ -25,7 +25,6 @@ class UserQueryServiceImpl : UserQueryService {
|
||||||
override suspend fun findByIds(ids: List<Long>): List<User> =
|
override suspend fun findByIds(ids: List<Long>): List<User> =
|
||||||
Users.select { Users.id inList ids }.map { it.toUser() }
|
Users.select { Users.id inList ids }.map { it.toUser() }
|
||||||
|
|
||||||
override suspend fun existByNameAndDomain(name: String, domain: String): Boolean {
|
override suspend fun existByNameAndDomain(name: String, domain: String): Boolean =
|
||||||
return Users.select { Users.name eq name and (Users.domain eq domain) }.empty().not()
|
Users.select { Users.name eq name and (Users.domain eq domain) }.empty().not()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import io.ktor.server.request.*
|
||||||
import io.ktor.server.response.*
|
import io.ktor.server.response.*
|
||||||
import io.ktor.server.routing.*
|
import io.ktor.server.routing.*
|
||||||
|
|
||||||
@Suppress("LongMethod")
|
@Suppress("LongMethod", "CognitiveComplexMethod")
|
||||||
fun Route.users(userService: IUserService, userApiService: IUserApiService) {
|
fun Route.users(userService: IUserService, userApiService: IUserApiService) {
|
||||||
route("/users") {
|
route("/users") {
|
||||||
get {
|
get {
|
||||||
|
|
|
@ -52,12 +52,12 @@ class PostApiServiceImpl(
|
||||||
userId: Long?
|
userId: Long?
|
||||||
): List<PostResponse> = transaction.transaction {
|
): List<PostResponse> = transaction.transaction {
|
||||||
postResponseQueryService.findAll(
|
postResponseQueryService.findAll(
|
||||||
since?.toEpochMilli(),
|
since = since?.toEpochMilli(),
|
||||||
until?.toEpochMilli(),
|
until = until?.toEpochMilli(),
|
||||||
minId,
|
minId = minId,
|
||||||
maxId,
|
maxId = maxId,
|
||||||
limit,
|
limit = limit,
|
||||||
userId
|
userId = userId
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,6 +202,7 @@ class ExposedJobRepository(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("CyclomaticComplexMethod")
|
||||||
private fun String?.parseJsonMap(): Map<String, Any> {
|
private fun String?.parseJsonMap(): Map<String, Any> {
|
||||||
this ?: return emptyMap()
|
this ?: return emptyMap()
|
||||||
return json.parseToJsonElement(this).jsonObject.mapValues { (_, el) ->
|
return json.parseToJsonElement(this).jsonObject.mapValues { (_, el) ->
|
||||||
|
@ -232,6 +233,7 @@ class ExposedJobRepository(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("CyclomaticComplexMethod")
|
||||||
private fun Map<String, Any>.stringify(): String? {
|
private fun Map<String, Any>.stringify(): String? {
|
||||||
if (isEmpty()) {
|
if (isEmpty()) {
|
||||||
return null
|
return null
|
||||||
|
|
Loading…
Reference in New Issue