[+] Metrics (#95)

* Add actuator and micrometer

* update

* [-] Remove unused import

* [O] Make code less verbose

* format

* refactor

---------

Co-authored-by: Azalea <22280294+hykilpikonna@users.noreply.github.com>
This commit is contained in:
Menci
2024-12-13 05:47:31 +08:00
committed by GitHub
parent 8434842c65
commit c5dad11e5e
15 changed files with 225 additions and 54 deletions

View File

@@ -48,4 +48,4 @@ class Mai2Import(
) {
override fun createEmpty() = Maimai2DataExport()
override val userDataRepo = repos.userData
}
}

View File

@@ -17,6 +17,8 @@ class ApiException(val code: Int, message: Str) : RuntimeException(message) {
fun resp() = ResponseEntity.status(code).body(message.toString())
}
fun Exception.simpleDescribe(): String = if (this is ApiException) "E${code}" else javaClass.simpleName
@ControllerAdvice(basePackages = ["icu.samnyan"])
class GlobalExceptionHandler {
@ExceptionHandler(ApiException::class)