Search in sources :

Example 1 with RegInfoEntity

use of com.varsql.web.model.entity.user.RegInfoEntity in project varsql by varsqlinfo.

the class SqlStatsServiceImpl method findSqlLog.

/**
 * @Method Name  : findSqlLog
 * @Method 설명 : log 검색.
 * @작성자   : ytkim
 * @작성일   : 2018. 7. 26.
 * @변경이력  :
 * @param searchParameter
 * @return
 */
public ResponseResult findSqlLog(String vconnid, SearchParameter searchParameter) {
    Page<SqlHistoryEntity> result = sqlHistoryEntityRepository.findAll(SqlHistorySpec.logSqlSearch(vconnid, searchParameter), VarsqlUtils.convertSearchInfoToPage(searchParameter, SqlHistoryEntity.START_TIME));
    ResponseResult responseResult = new ResponseResult();
    responseResult.setItemList(result.getContent().stream().map(item -> {
        SqlHistoryResponseDTO sqlUserHistoryInfo = SqlHistoryMapper.INSTANCE.toDto(item);
        RegInfoEntity regInfo = item.getRegInfo();
        sqlUserHistoryInfo.setRegInfo(RegInfoDTO.builder().uid(regInfo.getUid()).uname(regInfo.getUname()).build());
        return sqlUserHistoryInfo;
    }).collect(Collectors.toList()));
    responseResult.setPage(PagingUtil.getPageObject(result.getTotalElements(), searchParameter));
    return responseResult;
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) SqlHistoryResponseDTO(com.varsql.web.dto.sql.SqlHistoryResponseDTO) RegInfoEntity(com.varsql.web.model.entity.user.RegInfoEntity) SqlHistoryEntity(com.varsql.web.model.entity.sql.SqlHistoryEntity)

Aggregations

SqlHistoryResponseDTO (com.varsql.web.dto.sql.SqlHistoryResponseDTO)1 SqlHistoryEntity (com.varsql.web.model.entity.sql.SqlHistoryEntity)1 RegInfoEntity (com.varsql.web.model.entity.user.RegInfoEntity)1 ResponseResult (com.vartech.common.app.beans.ResponseResult)1