wangjiang988 2 лет назад
Родитель
Сommit
1c16f3bf91

+ 1 - 1
pom.xml

@@ -35,7 +35,7 @@
         <pagehelper-spring-boot.version>1.1.2</pagehelper-spring-boot.version>
         <mapper-spring-boot.version>1.1.3</mapper-spring-boot.version>
         <java.version>1.8</java.version>
-        <springfox.version>2.6.1</springfox.version>
+        <springfox.version>2.9.2</springfox.version>
         <httpclient.version>4.3.5</httpclient.version>
         <okhttp.version>3.8.0</okhttp.version>
         <druid-spring-boot.version>1.1.2</druid-spring-boot.version>

+ 51 - 0
src/main/java/platform/config/SwaggerConfig.java

@@ -0,0 +1,51 @@
+package platform.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+@Configuration
+@EnableSwagger2//开启Swagger2的自动配置
+@Profile({"aliyun"})
+public class SwaggerConfig {
+//	@Bean
+//	public Docket peopleDeptApi() {
+//		return new Docket(DocumentationType.SWAGGER_2)
+//				.apiInfo(apiInfo("人才库", "人才库-人员,部门接口文档", "1.0"))
+//				.select()
+//				.apis(RequestHandlerSelectors.basePackage("com.allqj.platform_base_organization.base.controller"))
+//				.paths(PathSelectors.any())
+//				.build()
+//				.groupName("人员,部门API");
+//	}
+//	@Bean
+//	public Docket brokerApi() {
+//		return new Docket(DocumentationType.SWAGGER_2)
+//				.apiInfo(apiInfo("人才库", "人才库-经纪人接口文档", "1.0"))
+//				.select()
+//				.apis(RequestHandlerSelectors.basePackage("com.allqj.platform_base_organization.broker.controller"))
+//				.paths(PathSelectors.any())
+//				.build()
+//				.groupName("经纪人API");
+//	}
+	@Bean
+	public Docket dictionaryApi() {
+		return new Docket(DocumentationType.SWAGGER_2)
+				.apiInfo(apiInfo("人才库", "人才库-字典接口文档", "1.0"))
+				.select()
+				.apis(RequestHandlerSelectors.basePackage("platform.modules"))
+				.paths(PathSelectors.any())
+				.build()
+				.groupName("字典API");
+	}
+	private ApiInfo apiInfo(String title, String description, String version) {
+		return new ApiInfoBuilder().title(title).description(description).version(version).build();
+	}
+}

+ 2 - 2
src/main/resources/application-prodin.yml

@@ -75,8 +75,8 @@ spring:
         #设置黑名单
         deny:
         #设置登录查看信息的账号密码
-  #        login-username: admin
-  #        login-password: admin
+        login-username: admin
+        login-password: abc.123
   #视图
   mvc:
     view:

+ 3 - 2
src/main/resources/application-prodout.yml

@@ -75,8 +75,9 @@ spring:
         #设置黑名单
         deny:
         #设置登录查看信息的账号密码
-  #        login-username: admin
-  #        login-password: admin
+        #设置登录查看信息的账号密码
+        login-username: admin
+        login-password: abc.123
   #视图
   mvc:
     view:

+ 4 - 4
src/main/resources/application-test.yml

@@ -68,14 +68,14 @@ spring:
       #        exclusions: *.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
       stat-view-servlet:
         enabled: false
-        url-pattern: /admin/sys/monitor/druid/*
+#        url-pattern: /admin/sys/monitor/druid/*
         #设置白名单
         #        allow: 10.105.0.220
         #设置黑名单
         deny:
         #设置登录查看信息的账号密码
-  #        login-username: admin
-  #        login-password: admin
+        login-username: admin
+        login-password: abc.123
   #视图
   mvc:
     view:
@@ -161,7 +161,7 @@ password: UEcXQ3aeLYx487dvi4nvfO074GaTay9celB6/OwmtgyRzcVdOsJ2m15U8IZpat+aq9UPAn
 
 #上传文件配置信息
 #文件仓库地址
-repositoryPath:  /opt/xinqu_pic
+repositoryPath:  /Users/wangjiang/codeCache/xinqu_pic
 
 #新区接口地址
 api_url: http://snd.ideatob.com/mp/api/