Skip to content

Commit

Permalink
fix: Fixed #49
Browse files Browse the repository at this point in the history
  • Loading branch information
T-baby committed Sep 26, 2021
1 parent 487bc58 commit f6b5231
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Expand Up @@ -50,9 +50,9 @@ object NextServer {

open val interceptors = mutableMapOf<String, MutableList<KClass<out Interceptor>>>()

val beforeRouteHandlersTable = mutableMapOf<String, MutableMap<HttpMethod, Array<Annotation>>>()
val beforeRouteHandlersTable = mutableMapOf<String, MutableMap<HttpMethod, MutableList<Annotation>>>()

val afterRouteHandlersTable = mutableMapOf<String, MutableMap<HttpMethod, Array<Annotation>>>()
val afterRouteHandlersTable = mutableMapOf<String, MutableMap<HttpMethod, MutableList<Annotation>>>()

val resourceTable = arrayListOf<ResourceTable>()

Expand Down Expand Up @@ -166,27 +166,27 @@ object NextServer {
if (annotation.annotationClass.hasAnnotation<Before>()) {
if (beforeRouteHandlersTable.containsKey(resourceUrl)) {
if (beforeRouteHandlersTable[resourceUrl]?.containsKey(httpMethod) == true) {
beforeRouteHandlersTable[resourceUrl]?.get(httpMethod)?.plus(annotation)
beforeRouteHandlersTable[resourceUrl]?.get(httpMethod)?.add(annotation)
} else {
beforeRouteHandlersTable[resourceUrl]?.set(httpMethod, arrayOf(annotation))
beforeRouteHandlersTable[resourceUrl]?.set(httpMethod, mutableListOf(annotation))
}
} else {
val temp = mutableMapOf<HttpMethod, Array<Annotation>>()
temp[httpMethod] = arrayOf(annotation)
val temp = mutableMapOf<HttpMethod, MutableList<Annotation>>()
temp[httpMethod] = mutableListOf(annotation)
beforeRouteHandlersTable[resourceUrl] = temp
}
}
if (annotation.annotationClass.hasAnnotation<After>()) {

if (afterRouteHandlersTable.containsKey(resourceUrl)) {
if (afterRouteHandlersTable[resourceUrl]?.containsKey(httpMethod) == true) {
afterRouteHandlersTable[resourceUrl]?.get(httpMethod)?.plus(annotation)
afterRouteHandlersTable[resourceUrl]?.get(httpMethod)?.add(annotation)
} else {
afterRouteHandlersTable[resourceUrl]?.set(httpMethod, arrayOf(annotation))
afterRouteHandlersTable[resourceUrl]?.set(httpMethod, mutableListOf(annotation))
}
} else {
val temp = mutableMapOf<HttpMethod, Array<Annotation>>()
temp[httpMethod] = arrayOf(annotation)
val temp = mutableMapOf<HttpMethod, MutableList<Annotation>>()
temp[httpMethod] = mutableListOf(annotation)
afterRouteHandlersTable[resourceUrl] = temp
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
@@ -1,4 +1,4 @@
project_version=3.0.1.0-SNAPSHOT
project_version=3.0.2.0-SNAPSHOT
java_version=11
kotlin_version=1.5.0
kotlinx_version=1.5.0
Expand Down

0 comments on commit f6b5231

Please sign in to comment.