@Configuration@EnableSwagger2publicclassSwaggerConfig{@BeanpublicDocketwebApiConfig(){//添加head参数startList<Parameter> pars =newArrayList<>();returnnewDocket(DocumentationType.SWAGGER_2).groupName("webApi").apiInfo(webApiInfo()).select().apis(RequestHandlerSelectors.basePackage("com.xxxxx.controller"))//这里设置要扫描的包名.build().globalOperationParameters(pars);}privateApiInfowebApiInfo(){returnnewApiInfoBuilder().title("xxx-API文档").description("本文档描述了zzz接口定义").version("1.0").contact(newContact("name","url","email"))//文档联系人配置.build();}}