![JAR search and dependency download from the Maven repository](/logo.png)
cloud.hedou.abp.identity.AbpRoleLevelDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of abp-spring-boot-starter Show documentation
Show all versions of abp-spring-boot-starter Show documentation
When the functions of ABP cannot meet service requirements, the Spring Boot framework can be used to expand its own services to make use of abundant Java frameworks on the market.
package cloud.hedou.abp.identity
import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.databind.DeserializationContext
import com.fasterxml.jackson.databind.deser.std.StdDeserializer
import com.fasterxml.jackson.databind.node.ObjectNode
class AbpRoleLevelDeserializer : StdDeserializer(Int::class.javaPrimitiveType) {
override fun deserialize(p: JsonParser, ctxt: DeserializationContext): Int {
val objectNode = p.readValueAsTree()
val jsonNode = objectNode.get("Level")
if(jsonNode.isInt) {
return jsonNode.intValue()
} else if(jsonNode.isTextual) {
return jsonNode.textValue().toInt()
}
return 0
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy