This commit is contained in:
xiangwb
2018-02-03 13:57:22 +08:00
parent 94222f3e4f
commit 813f414783
3 changed files with 47 additions and 11 deletions
@@ -1,7 +1,7 @@
package com.xwbing.demo;
import java.util.HashMap;
import java.util.Map;
import java.util.ArrayList;
import java.util.LinkedList;
/**
* 项目名称: boot-module-demo
@@ -11,9 +11,23 @@ import java.util.Map;
*/
public class demo {
public static void main(String[] args) {
Map<String, String> map = new HashMap<>();
String s = map.get(null);
System.out.println("");
ArrayList<Integer> objects = new ArrayList<>();
long l2 = System.currentTimeMillis();
for (int i=0;i<1000000;i++){
objects.add(i);
}
long l3 = System.currentTimeMillis();
System.out.println(l3-l2);
LinkedList<Integer> list = new LinkedList<>();
long l = System.currentTimeMillis();
for (int i=0;i<1000000;i++){
list.add(i);
}
long l1 = System.currentTimeMillis();
System.out.println(l1-l);
}
@@ -21,19 +21,41 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket buildDocket() {
public Docket sysDocket() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(buildApiInf())
.groupName("system")
.apiInfo(sysApiInf())
.select()
.apis(RequestHandlerSelectors.basePackage("com.xwbing.controller"))//controller路径
.apis(RequestHandlerSelectors.basePackage("com.xwbing.controller.sys"))
.paths(PathSelectors.any())
.build();
}
private ApiInfo buildApiInf() {
private ApiInfo sysApiInf() {
return new ApiInfoBuilder()
.title("Document RESTful APIs")
.description("API接口文档")
.description("系统接口文档")
.termsOfServiceUrl("http://localhost:8080/swagger-ui.html")
.contact(new Contact("项伟兵", "https://github.com/xiangwbs/boot-module-demo.git", "xiangwbs@163.com"))
.version("1.0.0")
.build();
}
@Bean
public Docket otherDocket() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("other")
.apiInfo(otherApiInf())
.select()
.apis(RequestHandlerSelectors.basePackage("com.xwbing.controller.other"))
.paths(PathSelectors.any())
.build();
}
private ApiInfo otherApiInf() {
return new ApiInfoBuilder()
.title("Document RESTful APIs")
.description("other接口文档")
.termsOfServiceUrl("http://localhost:8080/swagger-ui.html")
.contact(new Contact("项伟兵", "https://github.com/xiangwbs/boot-module-demo.git", "xiangwbs@163.com"))
.version("1.0.0")
@@ -1,4 +1,4 @@
package com.xwbing.controller;
package com.xwbing.controller.other;
import com.alibaba.fastjson.JSONObject;
import com.xwbing.annotation.LogInfo;