handle job
This commit is contained in:
@@ -33,6 +33,7 @@ enum class QueryParamType {
|
||||
sealed class QueryParam {
|
||||
data class StrParam(val str: String) : QueryParam()
|
||||
data class NumberParam(val nbr: Number) : QueryParam()
|
||||
data class BooleanParam(val bool: Boolean) : QueryParam()
|
||||
data class ComplexParam(val type: QueryParamType, val value: String) : QueryParam() {
|
||||
fun getValueComplex(): Any {
|
||||
return when (type) {
|
||||
@@ -63,6 +64,7 @@ sealed class QueryParam {
|
||||
is ComplexParam -> getValueComplex()
|
||||
is StrParam -> str
|
||||
is NumberParam -> nbr
|
||||
is BooleanParam -> bool
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,6 +76,8 @@ class QueryParamDeSerializer : JsonDeserializer<QueryParam>() {
|
||||
QueryParam.StrParam(node.asText())
|
||||
} else if (node.isNumber) {
|
||||
QueryParam.NumberParam(node.numberValue())
|
||||
} else if (node.isBoolean) {
|
||||
QueryParam.BooleanParam(node.booleanValue())
|
||||
} else if (node.isObject) {
|
||||
QueryParam.ComplexParam(
|
||||
QueryParamType.valueOf(node.get("type").textValue()),
|
||||
@@ -109,6 +113,7 @@ object Entities {
|
||||
}
|
||||
|
||||
e.update()
|
||||
ctx.json(OK)
|
||||
}
|
||||
|
||||
fun update(ctx: Context) {
|
||||
|
||||
Reference in New Issue
Block a user