use of com.varsql.web.model.entity.sql.SqlHistoryEntity 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;
}
use of com.varsql.web.model.entity.sql.SqlHistoryEntity in project varsql by varsqlinfo.
the class PluginServiceImpl method historySearch.
/**
* @Method Name : historySearch
* @Method 설명 : user sql history search
* @작성자 : ytkim
* @작성일 : 2018. 7. 24.
* @변경이력 :
* @param param
* @return
*/
public ResponseResult historySearch(SearchParameter searchParameter) {
Page<SqlHistoryEntity> result = sqlHistoryEntityRepository.findAll(SqlHistorySpec.userHisotryearch(String.valueOf(searchParameter.getCustomParam().get("conuid")), searchParameter), VarsqlUtils.convertSearchInfoToPage(searchParameter, SqlHistoryEntity.START_TIME));
ResponseResult responseResult = new ResponseResult();
responseResult.setItemList(result.getContent().stream().map(item -> {
SqlHistoryResponseDTO sqlUserHistoryInfo = SqlHistoryMapper.INSTANCE.toDto(item);
sqlUserHistoryInfo.setErrorLog(null);
sqlUserHistoryInfo.setUsrIp(null);
return sqlUserHistoryInfo;
}).collect(Collectors.toList()));
responseResult.setPage(PagingUtil.getPageObject(result.getTotalElements(), searchParameter));
return responseResult;
}
Aggregations