1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| @Configuration @EnableOpenApi
public class SwaggerConfig { @Bean public Docket docker() { return new Docket(DocumentationType.OAS_30) .apiInfo(apiInfo()) .groupName("group") .enable(true) .select() .apis(RequestHandlerSelectors.basePackage("cn.hellohao.controller"))
.build(); }
private ApiInfo apiInfo() { Contact contact = new Contact("名字:name", "个人链接:http://xxx.xxx.com/", "邮箱:XXX"); return new ApiInfo( "标题内容", "描述内容", "版本内容:v1.0", "链接:http://terms.service.url/", contact, "许可:Apach 2.0 ", "许可链接:XXX", new ArrayList<>() ); } }
|