From 43f9d5d336e7cf6a34f2c16ffbb7f98255538399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Fri, 21 Apr 2023 14:07:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=A8=A1=E5=9D=97=20=20?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../systemlog/controller/StatisticsController.java | 9 +++++ .../systemlog/controller/SysLogController.java | 8 +++++ .../hzims/middle/systemlog/entity/Statistics.java | 2 ++ .../hnac/hzims/middle/systemlog/entity/SysLog.java | 39 ++++++++++++++++++++-- .../hzims/middle/systemlog/vo/StatisticsVo.java | 4 +++ 5 files changed, 59 insertions(+), 3 deletions(-) diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/StatisticsController.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/StatisticsController.java index 71563bd..51e8e00 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/StatisticsController.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/StatisticsController.java @@ -7,10 +7,13 @@ import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.middle.systemlog.entity.Statistics; +import com.hnac.hzims.middle.systemlog.entity.SysLog; import com.hnac.hzims.middle.systemlog.service.StatisticsService; import com.hnac.hzims.middle.systemlog.vo.StatisticsVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; import org.springblade.core.tool.api.R; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -46,6 +49,9 @@ public class StatisticsController { operatorType = OperatorType.MANAGE, businessType = BusinessType.INSERT , title = "操作日志统计数据", action = "操作日志统计数据分页查询") + @ApiResponses({ + @ApiResponse(code = 200,message = "OK",response = Statistics.class), + }) @GetMapping("/selectPage/{page}/{size}") public R selectPage( @PathVariable Long page, @@ -63,6 +69,9 @@ public class StatisticsController { * @param id * @return */ + @ApiResponses({ + @ApiResponse(code = 200,message = "OK",response = Statistics.class), + }) @ApiOperation("根据Id查询日志") @OperationAnnotation(moduleName = "操作日志", operatorType = OperatorType.MANAGE, diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/SysLogController.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/SysLogController.java index 3bca2a1..7763c73 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/SysLogController.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/controller/SysLogController.java @@ -15,6 +15,8 @@ import com.hnac.hzims.middle.systemlog.vo.StatisticsVo; import com.hnac.hzims.middle.systemlog.vo.SysLogVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; @@ -82,6 +84,9 @@ public class SysLogController { ,title = "系统日志",action = "日志分页查询") @ApiOperation("日志分页查询") @GetMapping("/selectPage/{page}/{size}") + @ApiResponses({ + @ApiResponse(code = 200,message = "OK",response = SysLog.class), + }) public R selectPage( @PathVariable Long page, @PathVariable Long size, @@ -96,6 +101,9 @@ public class SysLogController { * 根据Id获取日志数据 * @return */ + @ApiResponses({ + @ApiResponse(code = 200,message = "OK",response = SysLog.class), + }) @OperationAnnotation(moduleName = "操作日志", operatorType = OperatorType.MANAGE, businessType = BusinessType.INSERT diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/Statistics.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/Statistics.java index 221004c..241de00 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/Statistics.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/Statistics.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; import java.time.YearMonth; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -23,6 +24,7 @@ import lombok.experimental.Accessors; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("hzims_statistics") +@ApiModel("操作日志统计对象") public class Statistics implements Serializable { private static final long serialVersionUID=1L; diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java index 210acca..0fd735d 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java @@ -1,17 +1,23 @@ package com.hnac.hzims.middle.systemlog.entity; import com.baomidou.mybatisplus.annotation.TableName; + import java.time.LocalDateTime; import java.sql.Blob; + import com.baomidou.mybatisplus.annotation.TableField; + import java.io.Serializable; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** *

- * + * *

* * @author dfy @@ -21,9 +27,10 @@ import lombok.experimental.Accessors; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("hzims_sys_log") +@ApiModel("系统日志统计对象") public class SysLog implements Serializable { - private static final long serialVersionUID=1L; + private static final long serialVersionUID = 1L; /** * 操作日志编号 @@ -35,165 +42,191 @@ public class SysLog implements Serializable { /** * 功能模块 */ + @ApiModelProperty("功能模块") @TableField("module_name") private String moduleName; /** * 租户ID */ + @ApiModelProperty("租户ID") @TableField("tenant_id") private String tenantId; /** * 服务器ip */ + @ApiModelProperty("服务器ip") @TableField("server_ip") private String serverIp; /** * 服务器地址 */ + @ApiModelProperty("服务器地址") @TableField("server_host") private String serverHost; /** * 服务名称 */ + @ApiModelProperty("服务名称") @TableField("server_name") private String serverName; /** * 环境 */ + @ApiModelProperty("环境") @TableField("env") private String env; /** * 操作人Id */ + @ApiModelProperty("操作人Id") @TableField("operation_user_id") private Long operationUserId; /** * 操作人名称 */ + @ApiModelProperty("操作人名称") @TableField("operation_user_name") private String operationUserName; /** * 请求路径 (操作地址) */ + @ApiModelProperty(" 请求路径 (操作地址)") @TableField("path") private String path; /** * 用户代理 */ + @ApiModelProperty("用户代理") @TableField("user_agent") private String userAgent; /** * 操作方式 */ + @ApiModelProperty("操作方式") @TableField("method") private String method; /** * 方法类 */ + @ApiModelProperty("方法类") @TableField("method_class") private String methodClass; /** * 方法名 */ + @ApiModelProperty("方法名") @TableField("method_name") private String methodName; /** * 方法执行时间 消耗时间 毫秒 */ + @ApiModelProperty("方法执行时间 消耗时间 毫秒") @TableField("cost_time") private String costTime; /** * 方法入参 */ + @ApiModelProperty("方法入参") @TableField("parameter") private String parameter; /** * 操作方法 */ + @ApiModelProperty("操作方法") @TableField("title") private String title; /** * 方法描述 */ + @ApiModelProperty("方法描述") @TableField("action") private String action; /** * 系统类型 */ + @ApiModelProperty("系统类型") @TableField("operator_type") private String operatorType; /** * 操作人类别 */ + @ApiModelProperty("操作人类别") @TableField("business_type") private String businessType; /** * 返回结果 */ + @ApiModelProperty("返回结果") @TableField("json_result") private String jsonResult; /** * 请求的Ip */ + @ApiModelProperty("请求的Ip") @TableField("local_ip") private String localIp; /** * 错误消息 */ + @ApiModelProperty("错误消息") @TableField("error_msg") private String errorMsg; /** * 操作时间 */ + @ApiModelProperty("操作时间") @TableField("operation_time") private LocalDateTime operationTime; /** * 操作状态(0 正常 1 异常) */ + @ApiModelProperty("操作状态") @TableField("status") private Integer status; /** * 创建时间 */ + @ApiModelProperty("创建时间") @TableField("create_time") private LocalDateTime createTime; /** * 更新时间 */ + @ApiModelProperty("更新时间") @TableField("update_time") private LocalDateTime updateTime; /** * 逻辑删除 (0 可用 1 删除) */ + @ApiModelProperty("逻辑删除") @TableField("is_deleted") private Integer isDeleted; - } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/StatisticsVo.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/StatisticsVo.java index deb7d7b..95d2493 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/StatisticsVo.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/StatisticsVo.java @@ -1,5 +1,6 @@ package com.hnac.hzims.middle.systemlog.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.time.LocalDate; @@ -24,11 +25,14 @@ public class StatisticsVo { /** * 开始时间 */ + @JsonFormat(pattern="yyyy-MM-dd ",timezone = "GMT+8",shape = JsonFormat.Shape.STRING) private LocalDate createTime; /** * 结束时间 + * */ + @JsonFormat(pattern="yyyy-MM-dd ",timezone = "GMT+8",shape = JsonFormat.Shape.STRING) private LocalDate endTime; }