Search in sources :

Example 1 with UacLog

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);
}
Also used : UacAction(com.paascloud.provider.model.domain.UacAction) UacLog(com.paascloud.provider.model.domain.UacLog) ModelMapper(org.modelmapper.ModelMapper)

Aggregations

UacAction (com.paascloud.provider.model.domain.UacAction)1 UacLog (com.paascloud.provider.model.domain.UacLog)1 ModelMapper (org.modelmapper.ModelMapper)1