mirror of https://github.com/elunez/eladmin
代码优化
parent
e6077c6613
commit
d9d50d3594
|
@ -28,8 +28,6 @@ import me.zhengjie.service.mapstruct.LogSmallMapper;
|
||||||
import me.zhengjie.utils.*;
|
import me.zhengjie.utils.*;
|
||||||
import org.aspectj.lang.ProceedingJoinPoint;
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
import org.aspectj.lang.reflect.MethodSignature;
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -50,7 +48,6 @@ import java.util.*;
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class LogServiceImpl implements LogService {
|
public class LogServiceImpl implements LogService {
|
||||||
private static final Logger log = LoggerFactory.getLogger(LogServiceImpl.class);
|
|
||||||
private final LogRepository logRepository;
|
private final LogRepository logRepository;
|
||||||
private final LogErrorMapper logErrorMapper;
|
private final LogErrorMapper logErrorMapper;
|
||||||
private final LogSmallMapper logSmallMapper;
|
private final LogSmallMapper logSmallMapper;
|
||||||
|
@ -125,7 +122,7 @@ public class LogServiceImpl implements LogService {
|
||||||
argList.add(map);
|
argList.add(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (argList.isEmpty() == 0) {
|
if (argList.isEmpty()) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return argList.size() == 1 ? JSONUtil.toJsonStr(argList.get(0)) : JSONUtil.toJsonStr(argList);
|
return argList.size() == 1 ? JSONUtil.toJsonStr(argList.get(0)) : JSONUtil.toJsonStr(argList);
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class ConfigurerAdapter implements WebMvcConfigurer {
|
||||||
// 使用 fastjson 序列化,会导致 @JsonIgnore 失效,可以使用 @JSONField(serialize = false) 替换
|
// 使用 fastjson 序列化,会导致 @JsonIgnore 失效,可以使用 @JSONField(serialize = false) 替换
|
||||||
FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter();
|
FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter();
|
||||||
List<MediaType> supportMediaTypeList = new ArrayList<>();
|
List<MediaType> supportMediaTypeList = new ArrayList<>();
|
||||||
supportMediaTypeList.add(MediaType.APPLICATION_JSON_UTF8);
|
supportMediaTypeList.add(MediaType.APPLICATION_JSON);
|
||||||
FastJsonConfig config = new FastJsonConfig();
|
FastJsonConfig config = new FastJsonConfig();
|
||||||
config.setDateFormat("yyyy-MM-dd HH:mm:ss");
|
config.setDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
config.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect);
|
config.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect);
|
||||||
|
|
Loading…
Reference in New Issue