@@ -50,9 +50,9 @@ object NextServer {
5050
5151 open val interceptors = mutableMapOf<String , MutableList <KClass <out Interceptor >>>()
5252
53- val beforeRouteHandlersTable = mutableMapOf<String , MutableMap <HttpMethod , Array <Annotation >>>()
53+ val beforeRouteHandlersTable = mutableMapOf<String , MutableMap <HttpMethod , MutableList <Annotation >>>()
5454
55- val afterRouteHandlersTable = mutableMapOf<String , MutableMap <HttpMethod , Array <Annotation >>>()
55+ val afterRouteHandlersTable = mutableMapOf<String , MutableMap <HttpMethod , MutableList <Annotation >>>()
5656
5757 val resourceTable = arrayListOf<ResourceTable >()
5858
@@ -166,27 +166,27 @@ object NextServer {
166166 if (annotation.annotationClass.hasAnnotation<Before >()) {
167167 if (beforeRouteHandlersTable.containsKey(resourceUrl)) {
168168 if (beforeRouteHandlersTable[resourceUrl]?.containsKey(httpMethod) == true ) {
169- beforeRouteHandlersTable[resourceUrl]?.get(httpMethod)?.plus (annotation)
169+ beforeRouteHandlersTable[resourceUrl]?.get(httpMethod)?.add (annotation)
170170 } else {
171- beforeRouteHandlersTable[resourceUrl]?.set(httpMethod, arrayOf (annotation))
171+ beforeRouteHandlersTable[resourceUrl]?.set(httpMethod, mutableListOf (annotation))
172172 }
173173 } else {
174- val temp = mutableMapOf<HttpMethod , Array <Annotation >>()
175- temp[httpMethod] = arrayOf (annotation)
174+ val temp = mutableMapOf<HttpMethod , MutableList <Annotation >>()
175+ temp[httpMethod] = mutableListOf (annotation)
176176 beforeRouteHandlersTable[resourceUrl] = temp
177177 }
178178 }
179179 if (annotation.annotationClass.hasAnnotation<After >()) {
180180
181181 if (afterRouteHandlersTable.containsKey(resourceUrl)) {
182182 if (afterRouteHandlersTable[resourceUrl]?.containsKey(httpMethod) == true ) {
183- afterRouteHandlersTable[resourceUrl]?.get(httpMethod)?.plus (annotation)
183+ afterRouteHandlersTable[resourceUrl]?.get(httpMethod)?.add (annotation)
184184 } else {
185- afterRouteHandlersTable[resourceUrl]?.set(httpMethod, arrayOf (annotation))
185+ afterRouteHandlersTable[resourceUrl]?.set(httpMethod, mutableListOf (annotation))
186186 }
187187 } else {
188- val temp = mutableMapOf<HttpMethod , Array <Annotation >>()
189- temp[httpMethod] = arrayOf (annotation)
188+ val temp = mutableMapOf<HttpMethod , MutableList <Annotation >>()
189+ temp[httpMethod] = mutableListOf (annotation)
190190 afterRouteHandlersTable[resourceUrl] = temp
191191 }
192192 }
@@ -205,7 +205,7 @@ object NextServer {
205205 Logger .configuration.color = webConfig.logColor
206206
207207 // Scan cloudopt handler
208- Classer .scanPackageByAnnotation(" net.cloudopt.next" , true , AutoHandler ::class )
208+ Classer .scanPackageByAnnotation(" net.cloudopt.next.web " , true , AutoHandler ::class )
209209 .forEach { kclass ->
210210 handlers.add(kclass.createInstance() as Handler )
211211 }
0 commit comments