diff --git a/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/advices/WrapResponseAdvice.kt b/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/advices/WrapResponseAdvice.kt index 17a9284..84b03ff 100644 --- a/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/advices/WrapResponseAdvice.kt +++ b/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/advices/WrapResponseAdvice.kt @@ -8,17 +8,17 @@ import org.springframework.http.server.ServerHttpRequest import org.springframework.http.server.ServerHttpResponse import org.springframework.web.bind.annotation.RestControllerAdvice import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice -import ru.touchin.wrapper.annotations.NoWrapResponse -import ru.touchin.wrapper.annotations.WrapResponse +import ru.touchin.wrapper.annotations.NoResponseWrap +import ru.touchin.wrapper.annotations.ResponseWrap import ru.touchin.wrapper.components.ResponseBodyWrapper -@RestControllerAdvice(annotations = [WrapResponse::class]) +@RestControllerAdvice(annotations = [ResponseWrap::class]) class WrapResponseAdvice( private val responseWrapper: ResponseBodyWrapper ): ResponseBodyAdvice { override fun supports(returnType: MethodParameter, converterType: Class>): Boolean { - return !returnType.hasMethodAnnotation(NoWrapResponse::class.java) + return !returnType.hasMethodAnnotation(NoResponseWrap::class.java) } /*** diff --git a/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/NoWrapResponse.kt b/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/NoResponseWrap.kt similarity index 78% rename from response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/NoWrapResponse.kt rename to response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/NoResponseWrap.kt index ecacdb1..5a84585 100644 --- a/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/NoWrapResponse.kt +++ b/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/NoResponseWrap.kt @@ -1,4 +1,4 @@ package ru.touchin.wrapper.annotations @Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.CLASS]) -annotation class NoWrapResponse +annotation class NoResponseWrap diff --git a/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/WrapResponse.kt b/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/ResponseWrap.kt similarity index 79% rename from response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/WrapResponse.kt rename to response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/ResponseWrap.kt index 2c34536..8a87f3e 100644 --- a/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/WrapResponse.kt +++ b/response-wrapper-spring-web/src/main/kotlin/ru/touchin/wrapper/annotations/ResponseWrap.kt @@ -1,4 +1,4 @@ package ru.touchin.wrapper.annotations @Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.CLASS]) -annotation class WrapResponse +annotation class ResponseWrap diff --git a/response-wrapper-spring-web/src/test/kotlin/ru/touchin/web/wrapper/WrapResponseAdviceMvcTest.kt b/response-wrapper-spring-web/src/test/kotlin/ru/touchin/web/wrapper/WrapResponseAdviceMvcTest.kt index 1e8467e..9469b5a 100644 --- a/response-wrapper-spring-web/src/test/kotlin/ru/touchin/web/wrapper/WrapResponseAdviceMvcTest.kt +++ b/response-wrapper-spring-web/src/test/kotlin/ru/touchin/web/wrapper/WrapResponseAdviceMvcTest.kt @@ -15,11 +15,11 @@ import org.springframework.test.web.servlet.result.MockMvcResultMatchers import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController -import ru.touchin.wrapper.annotations.NoWrapResponse -import ru.touchin.wrapper.annotations.WrapResponse +import ru.touchin.wrapper.annotations.NoResponseWrap +import ru.touchin.wrapper.annotations.ResponseWrap @RestController -@WrapResponse +@ResponseWrap @RequestMapping("/wrapper") class WrapperController { @@ -28,7 +28,7 @@ class WrapperController { return mapOf("wrap" to "yes") } - @NoWrapResponse + @NoResponseWrap @GetMapping("/no-wrap") fun noWrap(): Map { return mapOf("wrap" to "no")