use of com.varsql.web.dto.sql.SqlFileResponseDTO in project varsql by varsqlinfo.
the class UserPreferencesSqlFileServiceImpl method sqlFileList.
/**
* @Method Name : sqlFileList
* @Method 설명 :sql file list
* @작성자 : ytkim
* @작성일 : 2019. 10. 31.
* @변경이력 :
* @param searchParameter
* @return
*/
public ResponseResult sqlFileList(String vconnid, SearchParameter searchParameter) {
Page<SqlFileEntity> result = null;
if (vconnid != null && !"".equals(vconnid) && !"ALL".equals(vconnid)) {
result = sqlFileEntityRepository.findAll(SqlFileSpec.findVconnSqlFileNameOrCont(vconnid, searchParameter.getKeyword()), VarsqlUtils.convertSearchInfoToPage(searchParameter));
} else {
result = sqlFileEntityRepository.findAll(SqlFileSpec.findSqlFileNameOrCont(searchParameter.getKeyword()), VarsqlUtils.convertSearchInfoToPage(searchParameter));
}
return VarsqlUtils.getResponseResult(result.getContent().stream().map(item -> {
SqlFileResponseDTO resultItem = SqlFileMapper.INSTANCE.toDto(item);
resultItem.setVname(item.getConnInfo().getVname());
return resultItem;
}).collect(Collectors.toList()), result.getTotalElements(), searchParameter);
}
Aggregations