Browse Source

删除无用代码

NorthLan 7 years ago
parent
commit
a8be03cd66

+ 0 - 59
zen-core/src/main/kotlin/com/gxzc/zen/common/config/request/ZenArgumentResolver.kt

@@ -1,59 +0,0 @@
-//package com.gxzc.zen.common.config.request
-//
-//import com.fasterxml.jackson.databind.JsonNode
-//import com.fasterxml.jackson.databind.ObjectMapper
-//import com.gxzc.zen.common.config.request.annotation.ZenRequestTypes
-//import org.apache.commons.io.IOUtils
-//import org.springframework.core.MethodParameter
-//import org.springframework.web.bind.support.WebDataBinderFactory
-//import org.springframework.web.context.request.NativeWebRequest
-//import org.springframework.web.method.support.HandlerMethodArgumentResolver
-//import org.springframework.web.method.support.ModelAndViewContainer
-//import java.io.IOException
-//import java.nio.charset.Charset
-//import javax.servlet.http.HttpServletRequest
-//
-//
-///**
-// *
-// * @author NorthLan
-// * @date 2018/3/16
-// * @url https://noahlan.com
-// */
-//
-//class ZenArgumentResolver : HandlerMethodArgumentResolver {
-//
-//    private val mapper = ObjectMapper()
-//
-//    private val cacheNode = ThreadLocal<JsonNode>()
-//    private val latestMethodName = ThreadLocal<String>()
-//
-//    override fun supportsParameter(parameter: MethodParameter): Boolean {
-//        if (!parameter.hasParameterAnnotation(ZenRequestTypes::class.java)) {
-//            return false
-//        }
-//        val methodName = parameter.method.name
-//        if (latestMethodName.get().isNullOrEmpty()) {
-//            latestMethodName.set(methodName)
-//        } else {
-//            if (latestMethodName.get() == methodName) {
-//            } else {
-//                cacheNode.remove()
-//            }
-//        }
-//        return true
-//    }
-//
-//    override fun resolveArgument(parameter: MethodParameter, mavContainer: ModelAndViewContainer, webRequest: NativeWebRequest, binderFactory: WebDataBinderFactory): Any {
-//        val rootNode = try {
-//            cacheNode.get()
-//                    ?: mapper.readTree(webRequest.getNativeRequest(HttpServletRequest::class.java).inputStream)
-//        } catch (e: Exception) {
-//            null
-//        } ?: return Any()
-//        val annotation = parameter.getParameterAnnotation(ZenRequestTypes::class.java)
-//        val vaa = rootNode["data"].toString()
-//        val ret = mapper.readValue(vaa, annotation.value[0].value.java)
-//        return ret
-//    }
-//}

+ 0 - 19
zen-core/src/main/kotlin/com/gxzc/zen/common/config/request/ZenRequestConfigurer.kt

@@ -1,19 +0,0 @@
-//package com.gxzc.zen.common.config.request
-//
-//import org.springframework.context.annotation.Configuration
-//import org.springframework.web.method.support.HandlerMethodArgumentResolver
-//import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
-//
-///**
-// *
-// * @author NorthLan
-// * @date 2018/3/16
-// * @url https://noahlan.com
-// */
-//@Configuration
-//class ZenRequestConfigurer : WebMvcConfigurerAdapter() {
-//
-//    override fun addArgumentResolvers(argumentResolvers: MutableList<HandlerMethodArgumentResolver>) {
-////        argumentResolvers.add(ZenArgumentResolver())
-//    }
-//}