feat: 旋转图片验证使用多线程
This commit is contained in:
@@ -0,0 +1,149 @@
|
||||
package com.schisandra.system.application.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import com.schisandra.system.application.convert.SchisandraSysLogDTOConverter;
|
||||
import com.schisandra.system.application.dto.SchisandraSysLogDTO;
|
||||
import com.schisandra.system.common.entity.Result;
|
||||
import com.schisandra.system.domain.entity.SchisandraSysLogBO;
|
||||
import com.schisandra.system.domain.service.SchisandraSysLogDomainService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* controller
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/log/")
|
||||
@Slf4j
|
||||
public class SchisandraSysLogController {
|
||||
|
||||
@Resource
|
||||
private SchisandraSysLogDomainService schisandraSysLogDomainService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@RequestMapping("add")
|
||||
public Result<Boolean> add(@RequestBody SchisandraSysLogDTO schisandraSysLogDTO) {
|
||||
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraSysLogController.add.dto:{}", JSON.toJSONString(schisandraSysLogDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getId(), "编号不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getLogType(), "日志类型不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getLogTitle(), "日志标题不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getCreateBy(), "创建者不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getCreateByName(), "用户名称不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getCreateDate(), "创建时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRequestUri(), "请求URI不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRequestMethod(), "操作方式不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRequestParams(), "操作提交的数据不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getDiffModifyData(), "新旧数据比较结果不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getBizKey(), "业务主键不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getBizType(), "业务类型不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRemoteAddr(), "操作IP地址不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getServerAddr(), "请求服务器地址不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getIsException(), "是否异常不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getExceptionInfo(), "异常信息不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getUserAgent(), "用户代理不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getDeviceName(), "设备名称/操作系统不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getBrowserName(), "浏览器名称不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getExecuteTime(), "执行时间不能为空");
|
||||
SchisandraSysLogBO SchisandraSysLogBO = SchisandraSysLogDTOConverter.INSTANCE.convertDTOToBO(schisandraSysLogDTO);
|
||||
return Result.ok(schisandraSysLogDomainService.add(SchisandraSysLogBO));
|
||||
} catch (Exception e) {
|
||||
log.error("SchisandraSysLogController.register.error:{}", e.getMessage(), e);
|
||||
return Result.fail("新增失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("update")
|
||||
public Result<Boolean> update(@RequestBody SchisandraSysLogDTO schisandraSysLogDTO) {
|
||||
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraSysLogController.update.dto:{}", JSON.toJSONString(schisandraSysLogDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getId(), "编号不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getLogType(), "日志类型不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getLogTitle(), "日志标题不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getCreateBy(), "创建者不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getCreateByName(), "用户名称不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getCreateDate(), "创建时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRequestUri(), "请求URI不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRequestMethod(), "操作方式不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRequestParams(), "操作提交的数据不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getDiffModifyData(), "新旧数据比较结果不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getBizKey(), "业务主键不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getBizType(), "业务类型不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRemoteAddr(), "操作IP地址不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getServerAddr(), "请求服务器地址不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getIsException(), "是否异常不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getExceptionInfo(), "异常信息不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getUserAgent(), "用户代理不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getDeviceName(), "设备名称/操作系统不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getBrowserName(), "浏览器名称不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getExecuteTime(), "执行时间不能为空");
|
||||
SchisandraSysLogBO schisandraSysLogBO = SchisandraSysLogDTOConverter.INSTANCE.convertDTOToBO(schisandraSysLogDTO);
|
||||
return Result.ok(schisandraSysLogDomainService.update(schisandraSysLogBO));
|
||||
} catch (Exception e) {
|
||||
log.error("SchisandraSysLogController.update.error:{}", e.getMessage(), e);
|
||||
return Result.fail("更新信息失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("delete")
|
||||
public Result<Boolean> delete(@RequestBody SchisandraSysLogDTO schisandraSysLogDTO) {
|
||||
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraSysLogController.delete.dto:{}", JSON.toJSONString(schisandraSysLogDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getId(), "编号不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getLogType(), "日志类型不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getLogTitle(), "日志标题不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getCreateBy(), "创建者不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getCreateByName(), "用户名称不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getCreateDate(), "创建时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRequestUri(), "请求URI不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRequestMethod(), "操作方式不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRequestParams(), "操作提交的数据不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getDiffModifyData(), "新旧数据比较结果不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getBizKey(), "业务主键不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getBizType(), "业务类型不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getRemoteAddr(), "操作IP地址不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getServerAddr(), "请求服务器地址不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getIsException(), "是否异常不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getExceptionInfo(), "异常信息不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getUserAgent(), "用户代理不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getDeviceName(), "设备名称/操作系统不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getBrowserName(), "浏览器名称不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysLogDTO.getExecuteTime(), "执行时间不能为空");
|
||||
SchisandraSysLogBO schisandraSysLogBO = SchisandraSysLogDTOConverter.INSTANCE.convertDTOToBO(schisandraSysLogDTO);
|
||||
return Result.ok(schisandraSysLogDomainService.delete(schisandraSysLogBO));
|
||||
} catch (Exception e) {
|
||||
log.error("SchisandraSysLogController.delete.error:{}", e.getMessage(), e);
|
||||
return Result.fail("删除信息失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.schisandra.system.application.convert;
|
||||
|
||||
|
||||
import com.schisandra.system.application.dto.SchisandraSysLogDTO;
|
||||
import com.schisandra.system.domain.entity.SchisandraSysLogBO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* dto转换器
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
@Mapper
|
||||
public interface SchisandraSysLogDTOConverter {
|
||||
|
||||
SchisandraSysLogDTOConverter INSTANCE = Mappers.getMapper(SchisandraSysLogDTOConverter.class);
|
||||
|
||||
SchisandraSysLogBO convertDTOToBO(SchisandraSysLogDTO schisandraSysLogDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.schisandra.system.application.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* dto
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
@Data
|
||||
public class SchisandraSysLogDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 日志类型
|
||||
*/
|
||||
private String logType;
|
||||
|
||||
/**
|
||||
* 日志标题
|
||||
*/
|
||||
private String logTitle;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String createByName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 请求URI
|
||||
*/
|
||||
private String requestUri;
|
||||
|
||||
/**
|
||||
* 操作方式
|
||||
*/
|
||||
private String requestMethod;
|
||||
|
||||
/**
|
||||
* 操作提交的数据
|
||||
*/
|
||||
private String requestParams;
|
||||
|
||||
/**
|
||||
* 新旧数据比较结果
|
||||
*/
|
||||
private String diffModifyData;
|
||||
|
||||
/**
|
||||
* 业务主键
|
||||
*/
|
||||
private String bizKey;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 操作IP地址
|
||||
*/
|
||||
private String remoteAddr;
|
||||
|
||||
/**
|
||||
* 请求服务器地址
|
||||
*/
|
||||
private String serverAddr;
|
||||
|
||||
/**
|
||||
* 是否异常
|
||||
*/
|
||||
private String isException;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String exceptionInfo;
|
||||
|
||||
/**
|
||||
* 用户代理
|
||||
*/
|
||||
private String userAgent;
|
||||
|
||||
/**
|
||||
* 设备名称/操作系统
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 浏览器名称
|
||||
*/
|
||||
private String browserName;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
private BigDecimal executeTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.schisandra.system.domain.convert;
|
||||
|
||||
|
||||
import com.schisandra.system.domain.entity.SchisandraSysLogBO;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysLog;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* bo转换器
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
@Mapper
|
||||
public interface SchisandraSysLogBOConverter {
|
||||
|
||||
SchisandraSysLogBOConverter INSTANCE = Mappers.getMapper(SchisandraSysLogBOConverter.class);
|
||||
|
||||
SchisandraSysLog convertBOToEntity(SchisandraSysLogBO schisandraSysLogBO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.schisandra.system.domain.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* bo
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
@Data
|
||||
public class SchisandraSysLogBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 日志类型
|
||||
*/
|
||||
private String logType;
|
||||
|
||||
/**
|
||||
* 日志标题
|
||||
*/
|
||||
private String logTitle;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String createByName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 请求URI
|
||||
*/
|
||||
private String requestUri;
|
||||
|
||||
/**
|
||||
* 操作方式
|
||||
*/
|
||||
private String requestMethod;
|
||||
|
||||
/**
|
||||
* 操作提交的数据
|
||||
*/
|
||||
private String requestParams;
|
||||
|
||||
/**
|
||||
* 新旧数据比较结果
|
||||
*/
|
||||
private String diffModifyData;
|
||||
|
||||
/**
|
||||
* 业务主键
|
||||
*/
|
||||
private String bizKey;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 操作IP地址
|
||||
*/
|
||||
private String remoteAddr;
|
||||
|
||||
/**
|
||||
* 请求服务器地址
|
||||
*/
|
||||
private String serverAddr;
|
||||
|
||||
/**
|
||||
* 是否异常
|
||||
*/
|
||||
private String isException;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String exceptionInfo;
|
||||
|
||||
/**
|
||||
* 用户代理
|
||||
*/
|
||||
private String userAgent;
|
||||
|
||||
/**
|
||||
* 设备名称/操作系统
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 浏览器名称
|
||||
*/
|
||||
private String browserName;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
private BigDecimal executeTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.schisandra.system.domain.service;
|
||||
|
||||
import com.schisandra.system.domain.entity.SchisandraSysLogBO;
|
||||
|
||||
/**
|
||||
* 领域service
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
public interface SchisandraSysLogDomainService {
|
||||
|
||||
/**
|
||||
* 添加 信息
|
||||
*/
|
||||
Boolean add(SchisandraSysLogBO schisandraSysLogBO);
|
||||
|
||||
/**
|
||||
* 更新 信息
|
||||
*/
|
||||
Boolean update(SchisandraSysLogBO schisandraSysLogBO);
|
||||
|
||||
/**
|
||||
* 删除 信息
|
||||
*/
|
||||
Boolean delete(SchisandraSysLogBO schisandraSysLogBO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.schisandra.system.domain.service.impl;
|
||||
|
||||
|
||||
import com.schisandra.system.common.enums.IsDeletedFlagEnum;
|
||||
import com.schisandra.system.domain.convert.SchisandraSysLogBOConverter;
|
||||
import com.schisandra.system.domain.entity.SchisandraSysLogBO;
|
||||
import com.schisandra.system.domain.service.SchisandraSysLogDomainService;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysLog;
|
||||
import com.schisandra.system.infra.basic.service.SchisandraSysLogService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 领域service实现了
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SchisandraSysLogDomainServiceImpl implements SchisandraSysLogDomainService {
|
||||
|
||||
@Resource
|
||||
private SchisandraSysLogService schisandraSysLogService;
|
||||
|
||||
@Override
|
||||
public Boolean add(SchisandraSysLogBO schisandraSysLogBO) {
|
||||
SchisandraSysLog schisandraSysLog = SchisandraSysLogBOConverter.INSTANCE.convertBOToEntity(schisandraSysLogBO);
|
||||
return schisandraSysLogService.insert(schisandraSysLog) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(SchisandraSysLogBO schisandraSysLogBO) {
|
||||
SchisandraSysLog schisandraSysLog = SchisandraSysLogBOConverter.INSTANCE.convertBOToEntity(schisandraSysLogBO);
|
||||
return schisandraSysLogService.update(schisandraSysLog) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean delete(SchisandraSysLogBO schisandraSysLogBO) {
|
||||
SchisandraSysLog schisandraSysLog = new SchisandraSysLog();
|
||||
schisandraSysLog.setId(schisandraSysLogBO.getId());
|
||||
return schisandraSysLogService.update(schisandraSysLog) > 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.schisandra.system.infra.basic.dao;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysLog;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 表数据库访问层
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
@Repository
|
||||
public interface SchisandraSysLogDao extends BaseMapper<SchisandraSysLog> {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.schisandra.system.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
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 java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实体类
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
@Data
|
||||
@TableName("schisandra_sys_log")
|
||||
public class SchisandraSysLog implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(value = "`id`", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 日志类型
|
||||
*/
|
||||
@TableField("`log_type`")
|
||||
private String logType;
|
||||
|
||||
/**
|
||||
* 日志标题
|
||||
*/
|
||||
@TableField("`log_title`")
|
||||
private String logTitle;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField("`create_by`")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@TableField("`create_by_name`")
|
||||
private String createByName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("`create_date`")
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 请求URI
|
||||
*/
|
||||
@TableField("`request_uri`")
|
||||
private String requestUri;
|
||||
|
||||
/**
|
||||
* 操作方式
|
||||
*/
|
||||
@TableField("`request_method`")
|
||||
private String requestMethod;
|
||||
|
||||
/**
|
||||
* 操作提交的数据
|
||||
*/
|
||||
@TableField("`request_params`")
|
||||
private String requestParams;
|
||||
|
||||
/**
|
||||
* 新旧数据比较结果
|
||||
*/
|
||||
@TableField("`diff_modify_data`")
|
||||
private String diffModifyData;
|
||||
|
||||
/**
|
||||
* 业务主键
|
||||
*/
|
||||
@TableField("`biz_key`")
|
||||
private String bizKey;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
@TableField("`biz_type`")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 操作IP地址
|
||||
*/
|
||||
@TableField("`remote_addr`")
|
||||
private String remoteAddr;
|
||||
|
||||
/**
|
||||
* 请求服务器地址
|
||||
*/
|
||||
@TableField("`server_addr`")
|
||||
private String serverAddr;
|
||||
|
||||
/**
|
||||
* 是否异常
|
||||
*/
|
||||
@TableField("`is_exception`")
|
||||
private String isException;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
@TableField("`exception_info`")
|
||||
private String exceptionInfo;
|
||||
|
||||
/**
|
||||
* 用户代理
|
||||
*/
|
||||
@TableField("`user_agent`")
|
||||
private String userAgent;
|
||||
|
||||
/**
|
||||
* 设备名称/操作系统
|
||||
*/
|
||||
@TableField("`device_name`")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 浏览器名称
|
||||
*/
|
||||
@TableField("`browser_name`")
|
||||
private String browserName;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
@TableField("`execute_time`")
|
||||
private BigDecimal executeTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.schisandra.system.infra.basic.service;
|
||||
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysLog;
|
||||
|
||||
/**
|
||||
* 表服务接口
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
public interface SchisandraSysLogService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraSysLog queryById(Long id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param schisandraSysLog 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
int insert(SchisandraSysLog schisandraSysLog);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param schisandraSysLog 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
int update(SchisandraSysLog schisandraSysLog);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据条件查询角色
|
||||
*/
|
||||
SchisandraSysLog queryByCondition(SchisandraSysLog schisandraSysLog);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.schisandra.system.infra.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.schisandra.system.infra.basic.dao.SchisandraSysLogDao;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysLog;
|
||||
import com.schisandra.system.infra.basic.service.SchisandraSysLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 表服务实现类
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
@Service("SchisandraSysLogService")
|
||||
public class SchisandraSysLogServiceImpl implements SchisandraSysLogService {
|
||||
|
||||
@Resource
|
||||
private SchisandraSysLogDao schisandraSysLogDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSysLog queryById(Long id) {
|
||||
return this.schisandraSysLogDao.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param schisandraSysLog 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public int insert(SchisandraSysLog schisandraSysLog) {
|
||||
return this.schisandraSysLogDao.insert(schisandraSysLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param schisandraSysLog 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public int update(SchisandraSysLog schisandraSysLog) {
|
||||
return this.schisandraSysLogDao.updateById(schisandraSysLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.schisandraSysLogDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @param schisandraSysLog 条件
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSysLog queryByCondition(SchisandraSysLog schisandraSysLog) {
|
||||
|
||||
LambdaQueryWrapper<SchisandraSysLog> queryWrapper = Wrappers.<SchisandraSysLog>lambdaQuery()
|
||||
.eq(Objects.nonNull(schisandraSysLog.getId()), SchisandraSysLog::getId, schisandraSysLog.getId())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getLogType()), SchisandraSysLog::getLogType, schisandraSysLog.getLogType())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getLogTitle()), SchisandraSysLog::getLogTitle, schisandraSysLog.getLogTitle())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getCreateBy()), SchisandraSysLog::getCreateBy, schisandraSysLog.getCreateBy())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getCreateByName()), SchisandraSysLog::getCreateByName, schisandraSysLog.getCreateByName())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getCreateDate()), SchisandraSysLog::getCreateDate, schisandraSysLog.getCreateDate())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getRequestUri()), SchisandraSysLog::getRequestUri, schisandraSysLog.getRequestUri())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getRequestMethod()), SchisandraSysLog::getRequestMethod, schisandraSysLog.getRequestMethod())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getRequestParams()), SchisandraSysLog::getRequestParams, schisandraSysLog.getRequestParams())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getDiffModifyData()), SchisandraSysLog::getDiffModifyData, schisandraSysLog.getDiffModifyData())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getBizKey()), SchisandraSysLog::getBizKey, schisandraSysLog.getBizKey())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getBizType()), SchisandraSysLog::getBizType, schisandraSysLog.getBizType())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getRemoteAddr()), SchisandraSysLog::getRemoteAddr, schisandraSysLog.getRemoteAddr())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getServerAddr()), SchisandraSysLog::getServerAddr, schisandraSysLog.getServerAddr())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getIsException()), SchisandraSysLog::getIsException, schisandraSysLog.getIsException())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getExceptionInfo()), SchisandraSysLog::getExceptionInfo, schisandraSysLog.getExceptionInfo())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getUserAgent()), SchisandraSysLog::getUserAgent, schisandraSysLog.getUserAgent())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getDeviceName()), SchisandraSysLog::getDeviceName, schisandraSysLog.getDeviceName())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getBrowserName()), SchisandraSysLog::getBrowserName, schisandraSysLog.getBrowserName())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getExecuteTime()), SchisandraSysLog::getExecuteTime, schisandraSysLog.getExecuteTime())
|
||||
;
|
||||
return schisandraSysLogDao.selectOne(queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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="com.schisandra.system.infra.basic.dao.SchisandraSysLogDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.system.infra.basic.entity.SchisandraSysLog">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="log_type" jdbcType="VARCHAR" property="logType"/>
|
||||
<result column="log_title" jdbcType="VARCHAR" property="logTitle"/>
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
|
||||
<result column="create_by_name" jdbcType="VARCHAR" property="createByName"/>
|
||||
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
|
||||
<result column="request_uri" jdbcType="VARCHAR" property="requestUri"/>
|
||||
<result column="request_method" jdbcType="VARCHAR" property="requestMethod"/>
|
||||
<result column="request_params" jdbcType="VARCHAR" property="requestParams"/>
|
||||
<result column="diff_modify_data" jdbcType="VARCHAR" property="diffModifyData"/>
|
||||
<result column="biz_key" jdbcType="VARCHAR" property="bizKey"/>
|
||||
<result column="biz_type" jdbcType="VARCHAR" property="bizType"/>
|
||||
<result column="remote_addr" jdbcType="VARCHAR" property="remoteAddr"/>
|
||||
<result column="server_addr" jdbcType="VARCHAR" property="serverAddr"/>
|
||||
<result column="is_exception" jdbcType="CHAR" property="isException"/>
|
||||
<result column="exception_info" jdbcType="VARCHAR" property="exceptionInfo"/>
|
||||
<result column="user_agent" jdbcType="VARCHAR" property="userAgent"/>
|
||||
<result column="device_name" jdbcType="VARCHAR" property="deviceName"/>
|
||||
<result column="browser_name" jdbcType="VARCHAR" property="browserName"/>
|
||||
<result column="execute_time" jdbcType="DECIMAL" property="executeTime"/>
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user