Api版本管理

关于SpringMVC中如何添加,这一篇说的很详细了。

http://www.cnblogs.com/jcli/p/springmvc_restful_version.html

版本管理可以通过路径进行,也可以通过传递如version等额外参数进行。

另外可在getMatchingCondition中加些判断保证当没有传递版本参数时默认返回最新版本。

关于Springboot中如何添加,按如下操作即可。重写WebMvcRegistrationsAdapter时@Configuration注解需加上,否则由于多个方法的url映射相同,启动会报Ambiguous mapping错误。

https://blog.csdn.net/u010782227/article/details/74905404

原文地址:https://www.cnblogs.com/feixuefubing/p/9382050.html