 段飞宇
					
					3 years ago
						段飞宇
					
					3 years ago
					
				
				 16 changed files with 469 additions and 28 deletions
			
			
		| @ -0,0 +1,59 @@ | ||||
| package com.hnac.hzims.middle.systemlog.config; | ||||
| 
 | ||||
| import com.google.common.base.Predicates; | ||||
| import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.context.annotation.Configuration; | ||||
| import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; | ||||
| import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||||
| import springfox.documentation.builders.ApiInfoBuilder; | ||||
| import springfox.documentation.builders.PathSelectors; | ||||
| import springfox.documentation.service.ApiInfo; | ||||
| import springfox.documentation.service.Contact; | ||||
| import springfox.documentation.spi.DocumentationType; | ||||
| import springfox.documentation.spring.web.plugins.Docket; | ||||
| import springfox.documentation.swagger2.annotations.EnableSwagger2; | ||||
| 
 | ||||
| /** | ||||
|  * @Author WL | ||||
|  * @Version v1.0 | ||||
|  * @Serial 1.0 | ||||
|  * @Date 2023/4/13 13:40 | ||||
|  */ | ||||
| @Configuration | ||||
| @EnableSwagger2 | ||||
| public class Swagger2Config implements WebMvcConfigurer { | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public void addResourceHandlers(ResourceHandlerRegistry registry) { | ||||
|         registry.addResourceHandler("/**") | ||||
|                 .addResourceLocations("classpath:/static/"); | ||||
|         registry.addResourceHandler("doc.html") | ||||
|                 .addResourceLocations("classpath:/META-INF/resources/"); | ||||
|         registry.addResourceHandler("/webjars/**") | ||||
|                 .addResourceLocations("classpath:/META-INF/resources/webjars/"); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     @Bean | ||||
|     public Docket webApiConfig(){ | ||||
|         return new Docket(DocumentationType.SWAGGER_2) | ||||
|                 .groupName("日志模块") | ||||
|                 .apiInfo(webApiInfo()) | ||||
|                 .select() | ||||
|                 //只显示api路径下的页面
 | ||||
|                 .paths(Predicates.and(PathSelectors.regex("/systemlog/.*"))) | ||||
|                 .build(); | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     private ApiInfo webApiInfo() { | ||||
|         return new ApiInfoBuilder() | ||||
|                 .title("网站-API文档") | ||||
|                 .description("本文档描述了网站微服务接口定义") | ||||
|                 .version("1.0") | ||||
|                 .contact(new Contact("WL", "http://localhost:8501/", "55317332@qq.com")) | ||||
|                 .build(); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,34 @@ | ||||
| package com.hnac.hzims.middle.systemlog.vo; | ||||
| 
 | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.time.LocalDate; | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| /** | ||||
|  * @Author WL | ||||
|  * @Version v1.0 | ||||
|  * @Serial 1.0 | ||||
|  * @Date 2023/4/21 9:21 | ||||
|  */ | ||||
| @Data | ||||
| public class StatisticsVo { | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * key | ||||
|      */ | ||||
|     public String keyword; | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 开始时间 | ||||
|      */ | ||||
|     private LocalDate createTime; | ||||
| 
 | ||||
|     /** | ||||
|      * 结束时间 | ||||
|      */ | ||||
|     private LocalDate endTime; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,33 @@ | ||||
| package com.hnac.hzims.middle.systemlog.vo; | ||||
| 
 | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.time.LocalDate; | ||||
| 
 | ||||
| /** | ||||
|  * @Author WL | ||||
|  * @Version v1.0 | ||||
|  * @Serial 1.0 | ||||
|  * @Date 2023/4/21 9:53 | ||||
|  */ | ||||
| @Data | ||||
| public class SysLogVo { | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * key | ||||
|      */ | ||||
|     public String keyword; | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 开始时间 | ||||
|      */ | ||||
|     private LocalDate createTime; | ||||
| 
 | ||||
|     /** | ||||
|      * 结束时间 | ||||
|      */ | ||||
|     private LocalDate endTime; | ||||
| 
 | ||||
| } | ||||
					Loading…
					
					
				
		Reference in new issue