[+] Add "type" field to settings/get

pull/29/head
Azalea 2024-04-01 23:51:00 -04:00
parent 2d229b82c3
commit 44bab8c0c7
1 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import icu.samnyan.aqua.net.db.AquaNetUserRepo
import icu.samnyan.aqua.net.db.AquaUserServices import icu.samnyan.aqua.net.db.AquaUserServices
import org.springframework.web.bind.annotation.RestController import org.springframework.web.bind.annotation.RestController
import kotlin.reflect.full.findAnnotation import kotlin.reflect.full.findAnnotation
import kotlin.reflect.jvm.jvmErasure
@RestController @RestController
@API("/api/v2/settings") @API("/api/v2/settings")
@ -22,7 +23,8 @@ class SettingsApi(
val fieldDesc = fields.map { (f, an) -> mapOf( val fieldDesc = fields.map { (f, an) -> mapOf(
"key" to f.name, "key" to f.name,
"name" to an.name, "name" to an.name,
"desc" to an.desc "desc" to an.desc,
"type" to f.returnType.jvmErasure.simpleName
) } ) }
@API("get") @API("get")