GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — spring-boot-all/spring-boot-springfox at master · mifu2012/spring-boot-all

Expand file tree

/

spring-boot-springfox

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

spring-boot-springfox

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src
src
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 
spring-boot-springfox.jpg
spring-boot-springfox.jpg
 
 

README.md

spring-boot-springfox, 依赖spring-boot-parent

  • spring-boot
  • Springfox
  • Swagger

image

  • 项目启动后输入:http://localhost/swagger-ui.html

application.properties

# IDENTITY (ContextIdApplicationContextInitializer)
spring.application.index=SpringBootSpringfox.v1.1
spring.application.name=SpringBootSpringfox

#Server
server.port=80
server.jsp-servlet.class-name=org.apache.jasper.servlet.JspServlet

security.basic.enabled=false
management.security.enabled=false

#MVC
spring.mvc.view.prefix=/WEB-INF/views/

security.basic.enabled=false
management.security.enabled=false

#LOG
logging.config=classpath:log4j2.xml

configuration

@Configuration  
@EnableSwagger2
public class SwaggerConfig {
	
	@Bean
	public Docket adminApi(){
		return new Docket(DocumentationType.SWAGGER_2)
				.groupName("Admin API")
				.forCodeGeneration(true)
				.pathMapping("/")
				.select()
				.paths(paths())
				.build()
				.apiInfo(apiInfo())
				.useDefaultResponseMessages(false);
	}
	
	private Predicate<String> paths(){
		return Predicates.and(PathSelectors.regex("/.*"), Predicates.not(PathSelectors.regex("/error")));
	}
	
	
	private ApiInfo apiInfo(){
		Contact contact = new Contact("lance", "https://github.com/leelance", "[email protected]");
		return new ApiInfoBuilder()
				.title("Document Api")
				.description("Spring-boot-Springfox Example")
				.license("Apache License Version 2.0")
				.contact(contact)
				.version("2.0")
				.build();
	}
}

SimpleApplication

@SpringBootApplication
public class SimpleApplication {

	public static void main(String[] args) {
		SpringApplication.run(SimpleApplication.class, args);
	}
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.