diff --git a/boot-service/src/main/java/com/xwbing/demo/demo.java b/boot-service/src/main/java/com/xwbing/demo/demo.java index bbc3445..0cd1429 100644 --- a/boot-service/src/main/java/com/xwbing/demo/demo.java +++ b/boot-service/src/main/java/com/xwbing/demo/demo.java @@ -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 map = new HashMap<>(); - String s = map.get(null); - System.out.println(""); + + ArrayList 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 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); + } diff --git a/boot-web/src/main/java/com/xwbing/configuration/SwaggerConfig.java b/boot-web/src/main/java/com/xwbing/configuration/SwaggerConfig.java index cff929f..eb8b708 100644 --- a/boot-web/src/main/java/com/xwbing/configuration/SwaggerConfig.java +++ b/boot-web/src/main/java/com/xwbing/configuration/SwaggerConfig.java @@ -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") diff --git a/boot-web/src/main/java/com/xwbing/controller/TestControl.java b/boot-web/src/main/java/com/xwbing/controller/other/TestControl.java similarity index 99% rename from boot-web/src/main/java/com/xwbing/controller/TestControl.java rename to boot-web/src/main/java/com/xwbing/controller/other/TestControl.java index 81afbfe..2dae681 100644 --- a/boot-web/src/main/java/com/xwbing/controller/TestControl.java +++ b/boot-web/src/main/java/com/xwbing/controller/other/TestControl.java @@ -1,4 +1,4 @@ -package com.xwbing.controller; +package com.xwbing.controller.other; import com.alibaba.fastjson.JSONObject; import com.xwbing.annotation.LogInfo;