style(gradle): 格式化代码

This commit is contained in:
AiKrai 2025-03-11 15:04:35 +08:00
parent dff4e2d0a5
commit 278c5eb810
9 changed files with 18 additions and 22 deletions

View File

@ -18,12 +18,12 @@ object Application {
val getIt = InjectConfig.configure(vertx)
val mainVerticle = getIt.getInstance(MainVerticle::class.java)
vertx.deployVerticle(mainVerticle).onComplete {
if (it.failed()) {
logger.error { "MainVerticle startup failed: ${it.cause()?.stackTraceToString()}" }
} else {
logger.info { "MainVerticle startup successfully" }
}
if (it.failed()) {
logger.error { "MainVerticle startup failed: ${it.cause()?.stackTraceToString()}" }
} else {
logger.info { "MainVerticle startup successfully" }
}
}
}
}
}

View File

@ -6,8 +6,6 @@ import cn.hutool.core.util.IdUtil
import com.google.inject.*
import com.google.inject.name.Names
import io.vertx.core.Vertx
import io.vertx.core.http.HttpServer
import io.vertx.core.http.HttpServerOptions
import io.vertx.ext.auth.jwt.JWTAuth
import io.vertx.pgclient.PgBuilder
import io.vertx.pgclient.PgConnectOptions

View File

@ -2,7 +2,6 @@ package app.config
import org.aikrai.vertx.constant.HttpStatus
data class RespBean(
val code: Int,
val message: String,
@ -40,7 +39,6 @@ data class RespBean(
return RespBean(code, message, data)
}
// 访问受限,授权过期
fun forbidden(message: String?): RespBean {
return failure(HttpStatus.FORBIDDEN, message ?: "Restricted access, expired authorizations")

View File

@ -10,7 +10,7 @@ import org.aikrai.vertx.jackson.JsonUtil
import org.aikrai.vertx.utlis.Meta
@Singleton
class ResponseHandler: ResponseHandlerInterface {
class ResponseHandler : ResponseHandlerInterface {
private val logger = KotlinLogging.logger { }
override suspend fun normal(
@ -62,4 +62,4 @@ class ResponseHandler: ResponseHandlerInterface {
.putHeader("Content-Type", "application/json")
.end(resStr)
}
}
}

View File

@ -8,7 +8,7 @@ import org.aikrai.vertx.context.D
@D("Hello")
@Controller("/")
class HelloController {
suspend fun hello(): String {
return "Hello"
}
}
suspend fun hello(): String {
return "Hello"
}
}

View File

@ -5,7 +5,6 @@ import app.domain.account.modle.AccountRoleAccessDTO
import com.google.inject.Inject
import io.vertx.sqlclient.SqlClient
import org.aikrai.vertx.db.RepositoryImpl
import org.aikrai.vertx.db.tx.withTransaction
class AccountRepositoryImpl @Inject constructor(
sqlClient: SqlClient

View File

@ -19,7 +19,7 @@ class AccountService @Inject constructor(
private val accountRepository: AccountRepository,
private val tokenService: TokenService,
) {
private val logger = KotlinLogging.logger { }
private val logger = KotlinLogging.logger { }
suspend fun testTransaction() {
withTransaction {

View File

@ -41,7 +41,6 @@ class WebVerticle @Inject constructor(
) : CoroutineVerticle() {
private val logger = KotlinLogging.logger { }
override suspend fun start() {
val rootRouter = Router.router(vertx)
val router = Router.router(vertx)
@ -92,7 +91,7 @@ class WebVerticle @Inject constructor(
if (failure != null) {
logger.error { "${ctx.request().uri()}: ${failure.stackTraceToString()}" }
val resObj = when (failure) {
is Meta -> RespBean.failure(ctx.statusCode(),"${failure.name}:${failure.message}", failure.data)
is Meta -> RespBean.failure(ctx.statusCode(), "${failure.name}:${failure.message}", failure.data)
else -> RespBean.failure("${failure.javaClass.simpleName}${if (failure.message != null) ":${failure.message}" else ""}")
}
val resStr = JsonUtil.toJsonStr(resObj)

View File

@ -19,7 +19,7 @@ import org.junit.jupiter.api.extension.ExtendWith
* AuthControllerTest
*/
@ExtendWith(VertxExtension::class)
class AuthControllerTest{
class AuthControllerTest {
private var port = 8080
private var basePath = "/api"
@ -75,7 +75,9 @@ class AuthControllerTest{
basePath = "/$it".replace("//", "/")
}
vertx.setTimer(5000) { testContext.completeNow() }
} else testContext.failNow(ar.cause())
} else {
testContext.failNow(ar.cause())
}
}
}
}
}