Search in sources :

Example 1 with SqlHistoryEntity

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

Example 2 with SqlHistoryEntity

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;
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) SqlHistoryResponseDTO(com.varsql.web.dto.sql.SqlHistoryResponseDTO) SqlHistoryEntity(com.varsql.web.model.entity.sql.SqlHistoryEntity)

Aggregations

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