配置文件修改

devhuozheluoji
郭向斌 2 years ago
parent cdc3c5fe23
commit b903c453d7

@ -15,6 +15,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.enums.ModuleType;
import org.jeecg.common.constant.enums.OperateTypeEnum;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.IpUtils;
@ -52,17 +53,18 @@ public class AutoLogAspect {
}
@Around("logPointCut()")
public Object around(ProceedingJoinPoint point) throws Throwable {
public void around(ProceedingJoinPoint point) throws Throwable {
long beginTime = System.currentTimeMillis();
//执行方法
Object result = point.proceed();
//执行时长(毫秒)
long time = System.currentTimeMillis() - beginTime;
//保存日志
saveSysLog(point, time, result);
return result;
try{
Object result = point.proceed();
long time = System.currentTimeMillis() - beginTime;
saveSysLog(point, time, result);
}catch (Exception e){
long time = System.currentTimeMillis() - beginTime;
saveSysLog(point, time, e.getMessage());
throw new JeecgBootException(e.getMessage());
}
}
private void saveSysLog(ProceedingJoinPoint joinPoint, long time, Object obj) {
@ -95,6 +97,8 @@ public class AutoLogAspect {
//获取request
HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
dto.setRequestUrl(request.getRequestURL().toString());
dto.setRequestType(request.getMethod());
//请求的参数
dto.setRequestParam(getReqestParams(request,joinPoint));
//设置IP地址

@ -10,6 +10,9 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.enums.ModuleType;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.util.*;
import org.jeecg.modules.ocr.entity.OcrIdentify;
@ -64,6 +67,7 @@ public class ApiController {
@RequestMapping("/identify")
@Transactional
@ResponseBody
@AutoLog(value = "api接口-通用识别",logType = CommonConstant.OPERATE_TYPE_1)
public Result<?> pushSemantic(@RequestBody JSONObject requestBody) throws InterruptedException {
// if (!"test".equals(profiles)) {
// return Result.error("当前环境不支持该功能,请访问测试环境");

Loading…
Cancel
Save