【8.0】【log】更新业务日志详情表

pull/57/head
fengshuonan 2023-07-21 19:14:12 +08:00
parent 9504ac90aa
commit 89803da797
16 changed files with 474 additions and 70 deletions

View File

@ -32,7 +32,6 @@ import cn.stylefeng.roses.kernel.log.business.entity.SysLogBusiness;
import cn.stylefeng.roses.kernel.log.business.service.SysLogBusinessService;
import cn.stylefeng.roses.kernel.rule.annotation.BizLog;
import cn.stylefeng.roses.kernel.rule.util.HttpServletUtil;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
@ -116,9 +115,6 @@ public class BusinessLogRecordAop implements Ordered {
// 设置业务日志的类型编码
sysLogBusiness.setLogTypeCode(bizLog.logTypeCode());
// 设置调用链id
sysLogBusiness.setTraceId(IdWorker.getId());
// 设置请求的URL
String servletPath = HttpServletUtil.getRequest().getServletPath();
sysLogBusiness.setRequestUrl(servletPath);

View File

@ -0,0 +1,39 @@
package cn.stylefeng.roses.kernel.log.business.controller;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.log.business.entity.SysLogBusinessContent;
import cn.stylefeng.roses.kernel.log.business.pojo.request.SysLogBusinessContentRequest;
import cn.stylefeng.roses.kernel.log.business.service.SysLogBusinessContentService;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
@RestController
@ApiResource(name = "业务日志详情记录控制器")
public class SysLogBusinessContentController {
@Resource
private SysLogBusinessContentService sysLogBusinessContentService;
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
@GetResource(name = "分页获取业务日志详情", path = "/sysLogBusinessContent/page")
public ResponseData<PageResult<SysLogBusinessContent>> page(SysLogBusinessContentRequest sysLogBusinessContentRequest) {
return new SuccessResponseData<>(sysLogBusinessContentService.findPage(sysLogBusinessContentRequest));
}
}

View File

@ -8,15 +8,19 @@ import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
*
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
@RestController
@ApiResource(name = "业务日志记录")
@ -26,12 +30,70 @@ public class SysLogBusinessController {
private SysLogBusinessService sysLogBusinessService;
/**
*
*
*
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
@GetResource(name = "查询业务日志列表(带分页)", path = "/sysLogBusiness/page")
@PostResource(name = "添加", path = "/sysLogBusiness/add")
public ResponseData<SysLogBusiness> add(@RequestBody @Validated(SysLogBusinessRequest.add.class) SysLogBusinessRequest sysLogBusinessRequest) {
sysLogBusinessService.add(sysLogBusinessRequest);
return new SuccessResponseData<>();
}
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
@PostResource(name = "删除", path = "/sysLogBusiness/delete")
public ResponseData<?> delete(@RequestBody @Validated(SysLogBusinessRequest.delete.class) SysLogBusinessRequest sysLogBusinessRequest) {
sysLogBusinessService.del(sysLogBusinessRequest);
return new SuccessResponseData<>();
}
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
@PostResource(name = "编辑", path = "/sysLogBusiness/edit")
public ResponseData<?> edit(@RequestBody @Validated(SysLogBusinessRequest.edit.class) SysLogBusinessRequest sysLogBusinessRequest) {
sysLogBusinessService.edit(sysLogBusinessRequest);
return new SuccessResponseData<>();
}
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
@GetResource(name = "查看详情", path = "/sysLogBusiness/detail")
public ResponseData<SysLogBusiness> detail(@Validated(SysLogBusinessRequest.detail.class) SysLogBusinessRequest sysLogBusinessRequest) {
return new SuccessResponseData<>(sysLogBusinessService.detail(sysLogBusinessRequest));
}
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
@GetResource(name = "获取列表", path = "/sysLogBusiness/list")
public ResponseData<List<SysLogBusiness>> list(SysLogBusinessRequest sysLogBusinessRequest) {
return new SuccessResponseData<>(sysLogBusinessService.findList(sysLogBusinessRequest));
}
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
@GetResource(name = "分页查询", path = "/sysLogBusiness/page")
public ResponseData<PageResult<SysLogBusiness>> page(SysLogBusinessRequest sysLogBusinessRequest) {
return new SuccessResponseData<>(sysLogBusinessService.findPage(sysLogBusinessRequest));
}

View File

@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
*
*
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
@TableName("sys_log_business")
@Data
@ -41,20 +41,6 @@ public class SysLogBusiness extends BaseEntity {
@ChineseDescription("日志的标题,摘要信息")
private String logTitle;
/**
*
*/
@TableField("log_content")
@ChineseDescription("日志记录的内容")
private String logContent;
/**
* idid
*/
@TableField("trace_id")
@ChineseDescription("调用链唯一id一个id代表一次接口调用")
private Long traceId;
/**
* url
*/

View File

@ -0,0 +1,44 @@
package cn.stylefeng.roses.kernel.log.business.entity;
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
@TableName("sys_log_business_content")
@Data
@EqualsAndHashCode(callSuper = true)
public class SysLogBusinessContent extends BaseEntity {
/**
*
*/
@TableId(value = "content_id", type = IdType.ASSIGN_ID)
@ChineseDescription("主键")
private Long contentId;
/**
* id
*/
@TableField("business_log_id")
@ChineseDescription("对应主表主键id")
private Long businessLogId;
/**
*
*/
@TableField("log_content")
@ChineseDescription("日志记录的内容")
private String logContent;
}

View File

@ -0,0 +1,36 @@
package cn.stylefeng.roses.kernel.log.business.enums;
import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
import lombok.Getter;
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
@Getter
public enum SysLogBusinessContentExceptionEnum implements AbstractExceptionEnum {
/**
*
*/
SYS_LOG_BUSINESS_CONTENT_NOT_EXISTED(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10001", "查询结果不存在");
/**
*
*/
private final String errorCode;
/**
*
*/
private final String userTip;
SysLogBusinessContentExceptionEnum(String errorCode, String userTip) {
this.errorCode = errorCode;
this.userTip = userTip;
}
}

View File

@ -8,7 +8,7 @@ import lombok.Getter;
*
*
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
@Getter
public enum SysLogBusinessExceptionEnum implements AbstractExceptionEnum {

View File

@ -0,0 +1,14 @@
package cn.stylefeng.roses.kernel.log.business.mapper;
import cn.stylefeng.roses.kernel.db.mp.injector.CustomBaseMapper;
import cn.stylefeng.roses.kernel.log.business.entity.SysLogBusinessContent;
/**
* Mapper
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
public interface SysLogBusinessContentMapper extends CustomBaseMapper<SysLogBusinessContent> {
}

View File

@ -1,14 +1,14 @@
package cn.stylefeng.roses.kernel.log.business.mapper;
import cn.stylefeng.roses.kernel.db.mp.injector.CustomBaseMapper;
import cn.stylefeng.roses.kernel.log.business.entity.SysLogBusiness;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Mapper
*
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
public interface SysLogBusinessMapper extends CustomBaseMapper<SysLogBusiness> {
public interface SysLogBusinessMapper extends BaseMapper<SysLogBusiness> {
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.roses.kernel.log.business.mapper.SysLogBusinessContentMapper">
</mapper>

View File

@ -0,0 +1,39 @@
package cn.stylefeng.roses.kernel.log.business.pojo.request;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysLogBusinessContentRequest extends BaseRequest {
/**
*
*/
@NotNull(message = "主键不能为空", groups = {edit.class, delete.class})
@ChineseDescription("主键")
private Long contentId;
/**
* id
*/
@ChineseDescription("对应主表主键id")
private Long businessLogId;
/**
*
*/
@ChineseDescription("日志记录的内容")
private String logContent;
}

View File

@ -11,7 +11,7 @@ import javax.validation.constraints.NotNull;
*
*
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
@EqualsAndHashCode(callSuper = true)
@Data
@ -36,18 +36,6 @@ public class SysLogBusinessRequest extends BaseRequest {
@ChineseDescription("日志的标题,摘要信息")
private String logTitle;
/**
*
*/
@ChineseDescription("日志记录的内容")
private String logContent;
/**
* idid
*/
@ChineseDescription("调用链唯一id一个id代表一次接口调用")
private Long traceId;
/**
* url
*/

View File

@ -0,0 +1,82 @@
package cn.stylefeng.roses.kernel.log.business.service;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.log.business.entity.SysLogBusinessContent;
import cn.stylefeng.roses.kernel.log.business.pojo.request.SysLogBusinessContentRequest;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
public interface SysLogBusinessContentService extends IService<SysLogBusinessContent> {
/**
*
*
* @param sysLogBusinessContentRequest
* @author fengshuonan
* @date 2023/07/21 19:02
*/
void add(SysLogBusinessContentRequest sysLogBusinessContentRequest);
/**
*
*
* @param sysLogBusinessContentRequest
* @author fengshuonan
* @date 2023/07/21 19:02
*/
void del(SysLogBusinessContentRequest sysLogBusinessContentRequest);
/**
*
*
* @param sysLogBusinessContentRequest
* @author fengshuonan
* @date 2023/07/21 19:02
*/
void edit(SysLogBusinessContentRequest sysLogBusinessContentRequest);
/**
*
*
* @param sysLogBusinessContentRequest
* @author fengshuonan
* @date 2023/07/21 19:02
*/
SysLogBusinessContent detail(SysLogBusinessContentRequest sysLogBusinessContentRequest);
/**
*
*
* @param sysLogBusinessContentRequest
* @return List<SysLogBusinessContent>
* @author fengshuonan
* @date 2023/07/21 19:02
*/
List<SysLogBusinessContent> findList(SysLogBusinessContentRequest sysLogBusinessContentRequest);
/**
*
*
* @param sysLogBusinessContentRequest
* @return PageResult<SysLogBusinessContent>
* @author fengshuonan
* @date 2023/07/21 19:02
*/
PageResult<SysLogBusinessContent> findPage(SysLogBusinessContentRequest sysLogBusinessContentRequest);
/**
*
*
* @author fengshuonan
* @since 2023/7/21 19:07
*/
void batchSaveContent(List<SysLogBusinessContent> sysLogBusinessContentList);
}

View File

@ -11,63 +11,63 @@ import java.util.List;
*
*
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
public interface SysLogBusinessService extends IService<SysLogBusiness> {
/**
/**
*
*
* @param sysLogBusinessRequest
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
void add(SysLogBusinessRequest sysLogBusinessRequest);
/**
/**
*
*
* @param sysLogBusinessRequest
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
void del(SysLogBusinessRequest sysLogBusinessRequest);
/**
/**
*
*
* @param sysLogBusinessRequest
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
void edit(SysLogBusinessRequest sysLogBusinessRequest);
/**
/**
*
*
* @param sysLogBusinessRequest
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
SysLogBusiness detail(SysLogBusinessRequest sysLogBusinessRequest);
/**
/**
*
*
* @param sysLogBusinessRequest
* @param sysLogBusinessRequest
* @return List<SysLogBusiness>
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
List<SysLogBusiness> findList(SysLogBusinessRequest sysLogBusinessRequest);
/**
/**
*
*
* @param sysLogBusinessRequest
* @param sysLogBusinessRequest
* @return PageResult<SysLogBusiness>
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
PageResult<SysLogBusiness> findPage(SysLogBusinessRequest sysLogBusinessRequest);

View File

@ -0,0 +1,108 @@
package cn.stylefeng.roses.kernel.log.business.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.log.business.entity.SysLogBusinessContent;
import cn.stylefeng.roses.kernel.log.business.enums.SysLogBusinessContentExceptionEnum;
import cn.stylefeng.roses.kernel.log.business.mapper.SysLogBusinessContentMapper;
import cn.stylefeng.roses.kernel.log.business.pojo.request.SysLogBusinessContentRequest;
import cn.stylefeng.roses.kernel.log.business.service.SysLogBusinessContentService;
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
@Service
public class SysLogBusinessContentServiceImpl extends ServiceImpl<SysLogBusinessContentMapper, SysLogBusinessContent> implements
SysLogBusinessContentService {
@Override
public void add(SysLogBusinessContentRequest sysLogBusinessContentRequest) {
SysLogBusinessContent sysLogBusinessContent = new SysLogBusinessContent();
BeanUtil.copyProperties(sysLogBusinessContentRequest, sysLogBusinessContent);
this.save(sysLogBusinessContent);
}
@Override
public void del(SysLogBusinessContentRequest sysLogBusinessContentRequest) {
SysLogBusinessContent sysLogBusinessContent = this.querySysLogBusinessContent(sysLogBusinessContentRequest);
this.removeById(sysLogBusinessContent.getContentId());
}
@Override
public void edit(SysLogBusinessContentRequest sysLogBusinessContentRequest) {
SysLogBusinessContent sysLogBusinessContent = this.querySysLogBusinessContent(sysLogBusinessContentRequest);
BeanUtil.copyProperties(sysLogBusinessContentRequest, sysLogBusinessContent);
this.updateById(sysLogBusinessContent);
}
@Override
public SysLogBusinessContent detail(SysLogBusinessContentRequest sysLogBusinessContentRequest) {
return this.querySysLogBusinessContent(sysLogBusinessContentRequest);
}
@Override
public PageResult<SysLogBusinessContent> findPage(SysLogBusinessContentRequest sysLogBusinessContentRequest) {
LambdaQueryWrapper<SysLogBusinessContent> wrapper = createWrapper(sysLogBusinessContentRequest);
Page<SysLogBusinessContent> sysRolePage = this.page(PageFactory.defaultPage(), wrapper);
return PageResultFactory.createPageResult(sysRolePage);
}
@Override
public void batchSaveContent(List<SysLogBusinessContent> sysLogBusinessContentList) {
this.getBaseMapper().insertBatchSomeColumn(sysLogBusinessContentList);
}
@Override
public List<SysLogBusinessContent> findList(SysLogBusinessContentRequest sysLogBusinessContentRequest) {
LambdaQueryWrapper<SysLogBusinessContent> wrapper = this.createWrapper(sysLogBusinessContentRequest);
return this.list(wrapper);
}
/**
*
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
private SysLogBusinessContent querySysLogBusinessContent(SysLogBusinessContentRequest sysLogBusinessContentRequest) {
SysLogBusinessContent sysLogBusinessContent = this.getById(sysLogBusinessContentRequest.getContentId());
if (ObjectUtil.isEmpty(sysLogBusinessContent)) {
throw new ServiceException(SysLogBusinessContentExceptionEnum.SYS_LOG_BUSINESS_CONTENT_NOT_EXISTED);
}
return sysLogBusinessContent;
}
/**
* wrapper
*
* @author fengshuonan
* @date 2023/07/21 19:02
*/
private LambdaQueryWrapper<SysLogBusinessContent> createWrapper(SysLogBusinessContentRequest sysLogBusinessContentRequest) {
LambdaQueryWrapper<SysLogBusinessContent> queryWrapper = new LambdaQueryWrapper<>();
Long contentId = sysLogBusinessContentRequest.getContentId();
Long businessLogId = sysLogBusinessContentRequest.getBusinessLogId();
String logContent = sysLogBusinessContentRequest.getLogContent();
queryWrapper.eq(ObjectUtil.isNotNull(contentId), SysLogBusinessContent::getContentId, contentId);
queryWrapper.eq(ObjectUtil.isNotNull(businessLogId), SysLogBusinessContent::getBusinessLogId, businessLogId);
queryWrapper.like(ObjectUtil.isNotEmpty(logContent), SysLogBusinessContent::getLogContent, logContent);
return queryWrapper;
}
}

View File

@ -6,9 +6,11 @@ import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.log.business.entity.SysLogBusiness;
import cn.stylefeng.roses.kernel.log.business.entity.SysLogBusinessContent;
import cn.stylefeng.roses.kernel.log.business.enums.SysLogBusinessExceptionEnum;
import cn.stylefeng.roses.kernel.log.business.mapper.SysLogBusinessMapper;
import cn.stylefeng.roses.kernel.log.business.pojo.request.SysLogBusinessRequest;
import cn.stylefeng.roses.kernel.log.business.service.SysLogBusinessContentService;
import cn.stylefeng.roses.kernel.log.business.service.SysLogBusinessService;
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -16,6 +18,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@ -23,11 +26,14 @@ import java.util.List;
*
*
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
@Service
public class SysLogBusinessServiceImpl extends ServiceImpl<SysLogBusinessMapper, SysLogBusiness> implements SysLogBusinessService {
@Resource
private SysLogBusinessContentService sysLogBusinessContentService;
@Override
public void add(SysLogBusinessRequest sysLogBusinessRequest) {
SysLogBusiness sysLogBusiness = new SysLogBusiness();
@ -67,15 +73,18 @@ public class SysLogBusinessServiceImpl extends ServiceImpl<SysLogBusinessMapper,
return;
}
List<SysLogBusiness> sysLogBusinesses = new ArrayList<>();
for (String content : batchContentList) {
SysLogBusiness sysLogBusiness = new SysLogBusiness();
BeanUtil.copyProperties(context, sysLogBusiness);
sysLogBusiness.setLogContent(content);
sysLogBusinesses.add(sysLogBusiness);
}
// 先保存基础的日志信息
this.save(context);
this.getBaseMapper().insertBatchSomeColumn(sysLogBusinesses);
// 再保存详细的日志信息
List<SysLogBusinessContent> sysLogBusinessContentList = new ArrayList<>();
for (String content : batchContentList) {
SysLogBusinessContent sysLogBusinessContent = new SysLogBusinessContent();
sysLogBusinessContent.setBusinessLogId(context.getBusinessLogId());
sysLogBusinessContent.setLogContent(content);
sysLogBusinessContentList.add(sysLogBusinessContent);
}
this.sysLogBusinessContentService.batchSaveContent(sysLogBusinessContentList);
}
@Override
@ -88,7 +97,7 @@ public class SysLogBusinessServiceImpl extends ServiceImpl<SysLogBusinessMapper,
*
*
* @author fengshuonan
* @date 2023/07/21 15:00
* @date 2023/07/21 19:02
*/
private SysLogBusiness querySysLogBusiness(SysLogBusinessRequest sysLogBusinessRequest) {
SysLogBusiness sysLogBusiness = this.getById(sysLogBusinessRequest.getBusinessLogId());
@ -111,15 +120,11 @@ public class SysLogBusinessServiceImpl extends ServiceImpl<SysLogBusinessMapper,
String logTypeCode = sysLogBusinessRequest.getLogTypeCode();
queryWrapper.eq(ObjectUtil.isNotEmpty(logTypeCode), SysLogBusiness::getLogTypeCode, logTypeCode);
// 根据调用链日志信息查询
Long traceId = sysLogBusinessRequest.getTraceId();
queryWrapper.eq(ObjectUtil.isNotNull(traceId), SysLogBusiness::getTraceId, traceId);
// 根据文本检索内容查询
String searchText = sysLogBusinessRequest.getSearchText();
if (ObjectUtil.isNotEmpty(searchText)) {
queryWrapper.nested(wrap -> {
wrap.like(SysLogBusiness::getLogTitle, searchText).or().like(SysLogBusiness::getLogContent, searchText);
wrap.like(SysLogBusiness::getLogTitle, searchText).or().like(SysLogBusiness::getRequestUrl, searchText);
});
}