use of com.paascloud.provider.model.domain.UacLog in project paascloud-master by paascloud.
the class UacLogServiceImpl method saveOperationLog.
@Override
public Integer saveOperationLog(OperationLogDto operationLogDto) {
// 根据uri 查询url对应的权限
UacAction uacAction = uacActionService.matchesByUrl(operationLogDto.getRequestUrl());
if (uacAction != null) {
operationLogDto.setActionCode(uacAction.getActionCode());
operationLogDto.setActionName(uacAction.getActionName());
operationLogDto.setActionId(uacAction.getId());
}
ModelMapper modelMapper = new ModelMapper();
UacLog uacLog = modelMapper.map(operationLogDto, UacLog.class);
uacLog.setId(generateId());
// 获取操作位置
String locationById = opcRpcService.getLocationById(operationLogDto.getIp());
uacLog.setLocation(locationById);
return uacLogMapper.insertSelective(uacLog);
}
Aggregations