mirror of https://gitee.com/stylefeng/roses
完善日志管理功能,查看日志详情
parent
04752b8641
commit
adb94b9277
|
@ -48,6 +48,13 @@
|
|||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<!--log-sdk-db-->
|
||||
<dependency>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>log-sdk-db</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<!--web模块-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
|
|
@ -2,11 +2,13 @@ package cn.stylefeng.roses.kernel.log.modular.manage.controller;
|
|||
|
||||
import cn.stylefeng.roses.kernel.log.api.LogManagerApi;
|
||||
import cn.stylefeng.roses.kernel.log.api.pojo.manage.LogManagerParam;
|
||||
import cn.stylefeng.roses.kernel.log.db.service.SysLogService;
|
||||
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
|
||||
import cn.stylefeng.roses.kernel.resource.api.annotation.PostResource;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
@ -28,6 +30,11 @@ public class LogManagerController {
|
|||
*/
|
||||
@Resource
|
||||
private LogManagerApi logManagerApi;
|
||||
/**
|
||||
* 日志管理service
|
||||
*/
|
||||
@Resource
|
||||
private SysLogService sysLogService;
|
||||
|
||||
/**
|
||||
* 查询日志列表
|
||||
|
@ -63,4 +70,17 @@ public class LogManagerController {
|
|||
return new SuccessResponseData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看日志详情
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @author TSQ
|
||||
* @date 2021/1/11 17:36
|
||||
*/
|
||||
@GetResource(name = "查看日志详情", path = "/logManager/detail")
|
||||
public ResponseData detail(@Validated(LogManagerParam.detail.class) LogManagerParam logManagerParam) {
|
||||
return new SuccessResponseData(sysLogService.detail(logManagerParam));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ public class DbLogManagerServiceImpl implements LogManagerApi {
|
|||
|
||||
// 开始时间为空则用当天时间开始时间
|
||||
if (StrUtil.isEmpty(logManagerParam.getBeginDateTime())) {
|
||||
String beginDateTime = DateUtil.beginOfDay(DateUtil.date()).toString(DatePattern.NORM_DATETIME_FORMAT);
|
||||
String beginDateTime = DateUtil.beginOfDay(DateUtil.parse("2021-01-01 00:00:00")).toString(DatePattern.NORM_DATETIME_FORMAT);
|
||||
logManagerParam.setBeginDateTime(beginDateTime);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.stylefeng.roses.kernel.log.db.service;
|
||||
|
||||
import cn.stylefeng.roses.kernel.log.api.pojo.manage.LogManagerParam;
|
||||
import cn.stylefeng.roses.kernel.log.db.entity.SysLog;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
@ -11,4 +12,14 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface SysLogService extends IService<SysLog> {
|
||||
|
||||
/**
|
||||
* 查看日志详情
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @author TSQ
|
||||
* @date 2021/1/11 17:51
|
||||
*/
|
||||
SysLog detail(LogManagerParam logManagerParam);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package cn.stylefeng.roses.kernel.log.db.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.stylefeng.roses.kernel.log.api.pojo.manage.LogManagerParam;
|
||||
import cn.stylefeng.roses.kernel.log.db.entity.SysLog;
|
||||
import cn.stylefeng.roses.kernel.log.db.mapper.SysLogMapper;
|
||||
import cn.stylefeng.roses.kernel.log.db.service.SysLogService;
|
||||
|
@ -15,4 +18,22 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {
|
||||
|
||||
@Override
|
||||
public SysLog detail(LogManagerParam logManagerParam) {
|
||||
return this.querySysLog(logManagerParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询日志详细信息
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @author TSQ
|
||||
* @date 2021/1/11 17:54
|
||||
*/
|
||||
private SysLog querySysLog(LogManagerParam logManagerParam) {
|
||||
SysLog hrOrganization = this.getById(logManagerParam.getLogId());
|
||||
return hrOrganization;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue