haungxing
2 years ago
21 changed files with 632 additions and 36 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,41 @@
|
||||
package com.hnac.hzims.middle.systemlog.vo; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Data; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
||||
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; |
||||
|
||||
|
||||
/** |
||||
* 开始时间 |
||||
*/ |
||||
//@JsonFormat(pattern="yyyy-MM-dd",shape = JsonFormat.Shape.STRING)
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
private String createTime; |
||||
|
||||
/** |
||||
* 结束时间 |
||||
* |
||||
*/ |
||||
//@JsonFormat(pattern="yyyy-MM-dd",shape = JsonFormat.Shape.STRING)
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
private String endTime; |
||||
|
||||
} |
@ -0,0 +1,56 @@
|
||||
package com.hnac.hzims.middle.systemlog.vo; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
||||
import java.time.LocalDate; |
||||
import java.time.LocalDateTime; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/4/21 9:53 |
||||
*/ |
||||
@Data |
||||
public class SysLogVo { |
||||
|
||||
|
||||
@ApiModelProperty("功能模块") |
||||
private String moduleName; |
||||
|
||||
|
||||
/** |
||||
* 功能模块,操作方法,方法描述 模糊查询 |
||||
*/ |
||||
@ApiModelProperty("功能模块,操作方法,方法描述 模糊查询") |
||||
public String keyword; |
||||
|
||||
|
||||
/** |
||||
* 开始时间 |
||||
*/ |
||||
@ApiModelProperty(value = "开始时间") |
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private LocalDateTime createTime; |
||||
|
||||
/** |
||||
* 结束时间 |
||||
*/ |
||||
@ApiModelProperty(value = "结束时间") |
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private LocalDateTime endTime; |
||||
|
||||
|
||||
@ApiModelProperty("操作时间") |
||||
private String dateCalculated; |
||||
|
||||
|
||||
@ApiModelProperty("请求地址") |
||||
private String path; |
||||
|
||||
|
||||
} |
Loading…
Reference in new issue