feat(webmvc): Improve the priority of API version mapping processing

Make sure it executes before all other request mapping handlers by setting the order property of ApiVersionRequestMappingHandlerMapping to Int.MIN_VALUE. This ensures that version control requests are processed first, and improves the system's response speed and efficiency.
This commit is contained in:
gewuyou 2025-05-02 12:20:57 +08:00
parent e6f70b0e74
commit 47691cd605

View File

@ -28,6 +28,6 @@ open class VersionAutoConfiguration {
@Bean
open fun apiVersionRequestMappingHandlerMapping(versionProperties: VersionProperties): ApiVersionRequestMappingHandlerMapping {
log.info("创建 API 版本请求映射处理程序映射")
return ApiVersionRequestMappingHandlerMapping(versionProperties)
return ApiVersionRequestMappingHandlerMapping(versionProperties).also { it.order = Int.MIN_VALUE }
}
}