forked from Cookies_Github_mirror/AquaDX
[+] Special handler
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package icu.samnyan.aqua.sega.general
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException
|
||||
import jakarta.servlet.http.HttpServletRequest
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
@@ -9,3 +10,11 @@ fun interface BaseHandler {
|
||||
@Throws(JsonProcessingException::class)
|
||||
fun handle(request: Map<String, Any>): Any?
|
||||
}
|
||||
|
||||
data class RequestContext(
|
||||
val req: HttpServletRequest,
|
||||
val data: Map<String, Any>,
|
||||
)
|
||||
|
||||
typealias SpecialHandler = (RequestContext) -> Any?
|
||||
fun BaseHandler.toSpecial() = { ctx: RequestContext -> handle(ctx.data) }
|
||||
|
||||
Reference in New Issue
Block a user