商品快捷操作接口 以及 落地记录
This commit is contained in:
@@ -53,6 +53,13 @@ public interface LogService {
|
||||
@Async
|
||||
void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, Log log,Integer shopId);
|
||||
|
||||
/**
|
||||
* @param description 描述
|
||||
* @param method 方法
|
||||
* @param param 入参
|
||||
*/
|
||||
void save(String description,String method,String param);
|
||||
|
||||
/**
|
||||
* 查询异常详情
|
||||
* @param id 日志ID
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -120,6 +121,24 @@ public class LogServiceImpl implements LogService {
|
||||
logRepository.save(log);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(String description,String method,String param) {
|
||||
Log log = new Log();
|
||||
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
||||
log.setUsername(SecurityUtils.getCurrentUsername());
|
||||
log.setLogType("INFO");
|
||||
log.setBrowser(StringUtils.getBrowser(request));
|
||||
log.setRequestIp(StringUtils.getIp(request));
|
||||
log.setAddress(StringUtils.getCityInfo(log.getRequestIp()));
|
||||
|
||||
log.setDescription(description);
|
||||
log.setMethod(method);
|
||||
log.setParams(param);
|
||||
logRepository.save(log);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据方法和传入的参数获取请求参数
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user