为路由提供完整的HTTP方法注解支持

This commit is contained in:
tursom 2019-11-26 17:43:40 +08:00
parent da620b80e4
commit 75b0b43580

View File

@ -26,7 +26,11 @@ abstract class RoutedHttpHandler<T : HttpContent, in E : ExceptionContent>(
}
override fun handle(content: T) {
val handler = router[content.uri].first
val router = getRouter(content.method)
var handler = router[content.uri].first
if (handler == null) {
handler = this.router[content.uri].first
}
if (handler != null) {
handler(content)
} else {