pom.xml
<!--swgger2--> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.2.2</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.2.2</version> </dependency>springbootmybatis包下创建SwaggerConfig.java
SwaggerConfig @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket createRestApi() { ApiInfo apiInfo = new ApiInfoBuilder() .title("使用Swagger2构建RESTful APIs") //标题 .description("客户端与服务端接口文档") //描述 .termsOfServiceUrl("http://localost:8080") //域名地址 .contact("姜飞祥") //作者 .version("1.0.0") //版本号 .build(); return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo) .select() .apis(RequestHandlerSelectors.basePackage("com.example.springbootmybatis")) .paths(PathSelectors.any()) .build(); } }以上就算完成了,写的不好请见谅。具体测试请参考下面的springboot整合swgger2,之后访问:8080/swagger-ui.html即可,和
备注:springboot整合swgger2参考:https://www.jianshu.com/p/57a4381a2b45
MyBatis的Mapper接口以及Example的实例函数及详解:https://blog.csdn.net/biandous/article/details/65630783
Mybatis Generator最完整配置详解:https://www.jianshu.com/p/e09d2370b796