Skip to content

Instantly share code, notes, and snippets.

@marrek13
Created October 14, 2022 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marrek13/431ef4041730ddb985920baf154e3117 to your computer and use it in GitHub Desktop.
Save marrek13/431ef4041730ddb985920baf154e3117 to your computer and use it in GitHub Desktop.
class ApiRequestMappingHandlerMapping : RequestMappingHandlerMapping() {
override fun getCustomMethodCondition(method: Method): RequestCondition<ApiVersionCondition>? =
method.getAnnotation(ApiVersion::class.java)?.let { ApiVersionCondition(it.value) }
override fun getCustomTypeCondition(handlerType: Class<*>): RequestCondition<ApiVersionCondition>? =
handlerType.getAnnotation(ApiVersion::class.java)?.let { ApiVersionCondition(it.value) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment