use of com.weibo.model.OperationRecord in project motan by weibocom.
the class LoggingAspect method logAfter.
@AfterReturning(value = "anyPublicOperation() && execCommandOperation()", returning = "result")
public void logAfter(JoinPoint joinPoint, boolean result) {
Object[] args = joinPoint.getArgs();
OperationRecord record = new OperationRecord();
record.setOperator(getUsername());
record.setType(joinPoint.getSignature().getName());
record.setGroupName(args[0].toString());
record.setCommand(JSON.toJSONString(args[1]));
int status = result ? 1 : 0;
record.setStatus((byte) status);
if (recordMapper == null) {
LoggerUtil.accessLog(JSON.toJSONString(record));
} else {
recordMapper.insertSelective(record);
}
}
Aggregations