/**
* 记录日志功能
*
* @param joinPoint
* @param result
*/
@AfterReturning(value = "cutService()", returning = "result")
public void afterReturning(JoinPoint joinPoint, Object result) {
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
//获取方法对象
Method method = methodSignature.getMethod();
//获取方法上的注解
LogRecord annotation = method.getAnnotation(LogRecord.class);
UserDetail userDetail = (UserDetail) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
WaterOperationLog waterOperationLog = new WaterOperationLog()
.setClassName(method.getDeclaringClass().getName())//获取注解上的类名
.setMethodName(method.getName()) //获取方法名字
.setOperationContent(annotation.value()) //获取注解的内容
.setCreateTime(new Date())
.setUserId(userDetail.getUserId());
this.waterOperationLogMapper.insert(waterOperationLog);
}