[O] Reduce loc

This commit is contained in:
Azalea
2024-03-18 01:32:38 -04:00
parent f4cc9c7734
commit 5a9b7e296f
8 changed files with 118 additions and 410 deletions

View File

@@ -29,13 +29,17 @@ typealias API = RequestMapping
typealias Str = String
typealias Bool = Boolean
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.RUNTIME)
annotation class Doc(
val desc: String,
val ret: String = ""
)
@Target(AnnotationTarget.VALUE_PARAMETER)
@Retention(AnnotationRetention.RUNTIME)
annotation class SettingField(val name: Str, val desc: Str)
// Make it easier to throw a ResponseStatusException
operator fun HttpStatus.invoke(message: String? = null): Nothing = throw ApiException(value(), message ?: this.reasonPhrase)
operator fun Int.minus(message: String): Nothing {