feat: 旋转图片验证使用多线程
This commit is contained in:
@@ -16,7 +16,7 @@ import javax.annotation.Resource;
|
||||
@Slf4j
|
||||
public class SmsInitConfig implements SmartLifecycle {
|
||||
@Resource
|
||||
SmsConfig smsConfig;
|
||||
SmsReadConfig smsReadConfig;
|
||||
@Resource
|
||||
SmsConfigRpc smsConfigRpc;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class SmsInitConfig implements SmartLifecycle {
|
||||
log.info("短信配置获取失败!");
|
||||
}
|
||||
// 初始化短信配置
|
||||
SmsFactory.createSmsBlend(smsConfig, configInfo.getConfigValue());
|
||||
SmsFactory.createSmsBlend(smsReadConfig, configInfo.getConfigValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -2,7 +2,6 @@ package com.schisandra.auth.application.config;
|
||||
|
||||
import com.schisandra.auth.application.factory.SmsTypeHandlerFactory;
|
||||
import com.schisandra.auth.application.handler.SchisandraSmsTypeHandler;
|
||||
import org.dromara.sms4j.core.datainterface.SmsReadConfig;
|
||||
import org.dromara.sms4j.provider.config.BaseConfig;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -19,7 +18,7 @@ import java.util.List;
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Component
|
||||
public class SmsConfig implements SmsReadConfig {
|
||||
public class SmsReadConfig implements org.dromara.sms4j.core.datainterface.SmsReadConfig {
|
||||
|
||||
|
||||
@Resource
|
@@ -0,0 +1,28 @@
|
||||
package com.schisandra.auth.application.config;
|
||||
|
||||
import com.schisandra.auth.application.factory.CustomNameThreadFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.concurrent.LinkedBlockingDeque;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 线程池的config管理
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/18
|
||||
*/
|
||||
@Configuration
|
||||
public class ThreadPoolConfig {
|
||||
|
||||
@Bean(name = "rotateCaptchaThreadPool")
|
||||
public ThreadPoolExecutor getLabelThreadPool() {
|
||||
return new ThreadPoolExecutor(20, 100, 5,
|
||||
TimeUnit.SECONDS, new LinkedBlockingDeque<>(40),
|
||||
new CustomNameThreadFactory("rotateCaptcha"),
|
||||
new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
}
|
||||
|
||||
}
|
@@ -4,7 +4,9 @@ import com.schisandra.auth.application.dto.SchisandraCaptchaDTO;
|
||||
import com.schisandra.auth.common.entity.CaptchaResult;
|
||||
import com.schisandra.auth.common.redis.RedisUtil;
|
||||
import com.schisandra.auth.common.utils.AESUtils;
|
||||
import com.schisandra.auth.common.utils.MD5Util;
|
||||
import com.schisandra.auth.common.utils.RotateImageUtils;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -15,9 +17,11 @@ import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
@@ -40,25 +44,28 @@ public class ReactRotateCaptchaController {
|
||||
*/
|
||||
@PostMapping("get")
|
||||
public CaptchaResult get() throws Exception {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
RotateImageUtils rotateImageUtils = new RotateImageUtils();
|
||||
|
||||
InputStream inputStream= ReactRotateCaptchaController.class.getClassLoader().getResourceAsStream("image/test1.jpg");
|
||||
BufferedImage image = ImageIO.read(inputStream);
|
||||
Random random = new Random();
|
||||
double randomNumber = random.nextInt(280) + 40;
|
||||
String key = AESUtils.getKey();
|
||||
String token = AESUtils.encrypt(String.valueOf(randomNumber), key);
|
||||
String prefix = redisUtil.buildKey(authRotateCaptchaPrefix, token);
|
||||
redisUtil.setNx(prefix, String.valueOf(randomNumber), 60L, TimeUnit.SECONDS);
|
||||
try {
|
||||
BufferedImage image1 = rotateImageUtils.rotateImage(image, randomNumber, Color.black);
|
||||
map.put("token",token);
|
||||
map.put("str", RotateImageUtils.BufferedImageToBase64(image1));
|
||||
return CaptchaResult.ok(map);
|
||||
} catch (Exception e) {
|
||||
return CaptchaResult.fail();
|
||||
}
|
||||
CompletableFuture<HashMap> futurePrice = CompletableFuture.supplyAsync(() -> {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
try {
|
||||
Random random = new Random();
|
||||
double randomNumber = random.nextInt(280) + 40;
|
||||
InputStream inputStream = ReactRotateCaptchaController.class.getClassLoader().getResourceAsStream("image/test1.jpg");
|
||||
BufferedImage image = ImageIO.read(inputStream);
|
||||
String key = AESUtils.getKey();
|
||||
String token = AESUtils.encrypt(String.valueOf(randomNumber), key);
|
||||
String prefix = redisUtil.buildKey(authRotateCaptchaPrefix, token);
|
||||
redisUtil.setNx(prefix, String.valueOf(randomNumber), 60L, TimeUnit.SECONDS);
|
||||
BufferedImage image1 = rotateImageUtils.rotateImage(image, randomNumber, Color.black);
|
||||
String img = RotateImageUtils.BufferedImageToBase64(image1);
|
||||
map.put("token", token);
|
||||
map.put("str", img);
|
||||
} catch (Exception e) {
|
||||
log.error("ReactRotateCaptchaController.get.error:{}", e.getMessage(), e);
|
||||
}
|
||||
return map;
|
||||
});
|
||||
return CaptchaResult.ok(futurePrice.join());
|
||||
}
|
||||
|
||||
|
||||
|
@@ -0,0 +1,49 @@
|
||||
package com.schisandra.auth.application.factory;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 自定义名称的线程工厂
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024/2/18
|
||||
*/
|
||||
public class CustomNameThreadFactory implements ThreadFactory {
|
||||
|
||||
private static final AtomicInteger poolNumber = new AtomicInteger(1);
|
||||
private final ThreadGroup group;
|
||||
private final AtomicInteger threadNumber = new AtomicInteger(1);
|
||||
private final String namePrefix;
|
||||
|
||||
public CustomNameThreadFactory(String name) {
|
||||
SecurityManager s = System.getSecurityManager();
|
||||
group = (s != null) ? s.getThreadGroup() :
|
||||
Thread.currentThread().getThreadGroup();
|
||||
if (StringUtils.isBlank(name)) {
|
||||
name = "pool";
|
||||
}
|
||||
namePrefix = name + "-" +
|
||||
poolNumber.getAndIncrement() +
|
||||
"-thread-";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Thread newThread(Runnable r) {
|
||||
Thread t = new Thread(group, r,
|
||||
namePrefix + threadNumber.getAndIncrement(),
|
||||
0);
|
||||
// 设置线程为非守护线程
|
||||
if (t.isDaemon()){
|
||||
t.setDaemon(false);
|
||||
}
|
||||
// 设置线程优先级为正常优先级
|
||||
if (t.getPriority() != Thread.NORM_PRIORITY){
|
||||
t.setPriority(Thread.NORM_PRIORITY);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
package com.schisandra.auth.common.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @Classname CacheUtil
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-03-03 21:31
|
||||
* @Description: 缓存工具类
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Component
|
||||
public class CacheUtil<K, V> {
|
||||
private Cache<String, String> localCache =
|
||||
CacheBuilder.newBuilder()
|
||||
.maximumSize(5000)
|
||||
.expireAfterWrite(10, TimeUnit.SECONDS)
|
||||
.build();
|
||||
|
||||
public List<V> getResult(String cacheKey, Class<V> clazz,
|
||||
Function<String, List<V>> function) {
|
||||
List<V> resultList = new ArrayList<>();
|
||||
String content = localCache.getIfPresent(cacheKey);
|
||||
if (StringUtils.isNotBlank(content)) {
|
||||
resultList = JSON.parseArray(content, clazz);
|
||||
} else {
|
||||
resultList = function.apply(cacheKey);
|
||||
if (!CollectionUtils.isEmpty(resultList)) {
|
||||
localCache.put(cacheKey, JSON.toJSONString(resultList));
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
public Map<K, V> getMapResult(String cacheKey, Class<V> clazz,
|
||||
Function<String, Map<K, V>> function) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
}
|
@@ -8,23 +8,23 @@
|
||||
# 数据库连接信息
|
||||
jdbc:
|
||||
dbName: schisandra-cloud-storage
|
||||
tableName: schisandra_oss_config
|
||||
tableName: schisandra_sys_log
|
||||
url: jdbc:mysql://1.95.0.111:3306/
|
||||
username: root
|
||||
password: LDQ20020618xxx
|
||||
driver: com.mysql.cj.jdbc.Driver
|
||||
|
||||
# 使用的模板与生成文件映射给关系
|
||||
mapperInfos: genCode/ossMapper.yml
|
||||
mapperInfos: genCode/systemLogMapper.yml
|
||||
|
||||
# 全局参数
|
||||
params:
|
||||
# 作者
|
||||
author: landaiqing
|
||||
# 模块
|
||||
module: oss
|
||||
module: system
|
||||
# controller 通用前缀
|
||||
api: /oss
|
||||
api: /system/log
|
||||
# 生成对象是否移除前缀
|
||||
removePre: false
|
||||
# 使用内置函数赋值给变量 FunctionUtils 中替换
|
||||
|
@@ -54,7 +54,7 @@ mappers:
|
||||
ext: java
|
||||
- fileId: 011
|
||||
template: genCode/template/DemoDao.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/dao
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/mapper
|
||||
name: ${modelName}Dao
|
||||
ext: java
|
||||
- fileId: 012
|
||||
|
@@ -0,0 +1,69 @@
|
||||
# auth模块映射关系 ${module} 占位符
|
||||
# 模板文件和生成类的映射关系 多个文件 数组形式配置
|
||||
mappers:
|
||||
-
|
||||
- fileId: 001
|
||||
template: genCode/template/DemoDTO.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/dto
|
||||
name: ${modelName}DTO
|
||||
ext: java
|
||||
- fileId: 002
|
||||
template: genCode/template/DemoController.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/controller
|
||||
name: ${modelName}Controller
|
||||
ext: java
|
||||
- fileId: 003
|
||||
template: genCode/template/DemoDTOConverter.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/convert
|
||||
name: ${modelName}DTOConverter
|
||||
ext: java
|
||||
- fileId: 004
|
||||
template: genCode/template/DemoBO.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/entity
|
||||
name: ${modelName}BO
|
||||
ext: java
|
||||
- fileId: 005
|
||||
template: genCode/template/DemoDomainService.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/service
|
||||
name: ${modelName}DomainService
|
||||
ext: java
|
||||
- fileId: 006
|
||||
template: genCode/template/DemoDomainServiceImpl.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/service/impl
|
||||
name: ${modelName}DomainServiceImpl
|
||||
ext: java
|
||||
- fileId: 007
|
||||
template: genCode/template/DemoBOConverter.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/convert
|
||||
name: ${modelName}BOConverter
|
||||
ext: java
|
||||
- fileId: 008
|
||||
template: genCode/template/DemoService.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/service
|
||||
name: ${modelName}Service
|
||||
ext: java
|
||||
- fileId: 009
|
||||
template: genCode/template/DemoTable.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/entity
|
||||
name: ${modelName}
|
||||
ext: java
|
||||
- fileId: 010
|
||||
template: genCode/template/DemoServiceImpl.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/service/impl
|
||||
name: ${modelName}ServiceImpl
|
||||
ext: java
|
||||
- fileId: 011
|
||||
template: genCode/template/DemoDao.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/mapper
|
||||
name: ${modelName}Dao
|
||||
ext: java
|
||||
- fileId: 012
|
||||
template: genCode/template/DemoXml.xml.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/resources/mapper
|
||||
name: ${modelName}Dao
|
||||
ext: xml
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -54,7 +54,7 @@ mappers:
|
||||
ext: java
|
||||
- fileId: 011
|
||||
template: genCode/template/DemoDao.java.vm
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/dao
|
||||
filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/mapper
|
||||
name: ${modelName}Dao
|
||||
ext: java
|
||||
- fileId: 012
|
||||
|
@@ -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