Skip to content

Commit

Permalink
SpringBoot2.x 整合Mybatis(多数据源),Redis(含分布式锁实现),RabbitMQ,Thymeleaf,Swagg…
Browse files Browse the repository at this point in the history
…er2等实现简单案例
  • Loading branch information
g-HJY committed Jan 21, 2022
1 parent 7c97211 commit b68b66a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/example/demo/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.example.demo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
Expand All @@ -14,11 +15,14 @@
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Value("${swagger2.enable}")
private boolean swagger2Enable;

@Bean
public Docket webApiConfig(){

return new Docket(DocumentationType.SWAGGER_2)
.enable(swagger2Enable)
.groupName("webApi")
.apiInfo(webApiInfo())
.select()
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application-pro.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ server.port=9112
spring.application.name=hello

my.value = ${random.value}
#??????swagger???????
swagger2.enable = false

feedback.img.path =/usr/local/h_app/feedback
headImg.img.path =/usr/local/h_app/headImg
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/application-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spring.application.name=hello

my.value = ${random.value}


swagger2.enable = true

feedback.img.path =/usr/local/h_app/feedback
headImg.img.path =/usr/local/h_app/headImg

Expand Down

0 comments on commit b68b66a

Please sign in to comment.