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;
}
Aggregations