前后分离后接口实现先定义采用yaml的方式。
核心关键字:OpenAPI、swagger
教程:https://www.cnblogs.com/meihuashou/articles/16471654.html
swagger yaml 规范3.0
swagger yaml 规范2.0
swagger-api
生成代码基于swagger2.0的代码官方例子
一个能运行的例子
swagger-codegen-maven-pluging官方
https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen-maven-plugin
需要设置swagger生成的代码的文件夹为source
java - Remove ResponseEntity in swagger-codegen-maven-plugin api class - Stack Overflow
swagger codegen 和OpenAPI codegen的区别
多个接口文件可以参考Use Groovy to customize the Maven build process | Red Hat Developer
json - Generate code for multiple swaggers in the same project - Stack Overflow
数据类型:Data Types
多个接口文件的核心:
1、先保证单个的可以正常编译(A和B)
2、复制A接口yml文件及相关定义的yml文件到同B项目对应目录
3、修改B项目的pom.xml
3.1)复制一份(是一对)execution,然后对原来的execution增加id标签(如没有id标签的话增加)并将id的值命名为g01,原来B项目的execution的id标签的id值命名为g02
4、编译即可