Search in sources :

Example 1 with SearchParameter

use of com.vartech.common.app.beans.SearchParameter in project varsql by varsqlinfo.

the class PluginController method historySearch.

/**
 * @Method Name  : historySearch
 * @Method 설명 : sql history search.
 * @작성자   : ytkim
 * @작성일   : 2018. 7. 26.
 * @변경이력  :
 * @param req
 * @return
 * @throws Exception
 */
@RequestMapping(value = "/history/search", method = RequestMethod.POST)
@ResponseBody
public ResponseResult historySearch(HttpServletRequest req) throws Exception {
    SearchParameter param = HttpUtils.getSearchParameter(req);
    param.addCustomParam(VarsqlParamConstants.CONN_UUID, SecurityUtil.getVconnid(String.valueOf(param.getCustomParam().get(VarsqlParamConstants.CONN_UUID))));
    param.addCustomParam(VarsqlParamConstants.UID, SecurityUtil.userViewId());
    return pluginServiceImpl.historySearch(param);
}
Also used : SearchParameter(com.vartech.common.app.beans.SearchParameter) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with SearchParameter

use of com.vartech.common.app.beans.SearchParameter in project varsql by varsqlinfo.

the class AdminDbMgmtServiceImpl method jdbcProviderList.

public ResponseResult jdbcProviderList(SearchParameter searchParameter) {
    Sort sort = Sort.by(Sort.Direction.ASC, DBTypeDriverProviderEntity.DB_TYPE).and(Sort.by(Sort.Direction.ASC, DBTypeDriverProviderEntity.PROVIDER_NAME));
    List<DBTypeDriverProviderEntity> result = dbTypeDriverProviderRepository.findAll(DBTypeDriverProviderSpec.searchField(searchParameter), sort);
    List<DBTypeDriverProviderResponseDTO> list = result.stream().map(item -> {
        DBTypeDriverProviderResponseDTO dto = new DBTypeDriverProviderResponseDTO();
        dto.setDbType(item.getDbType());
        dto.setProviderName(item.getProviderName());
        dto.setDriverProviderId(item.getDriverProviderId());
        dto.setDriverId(item.getDriverId());
        dto.setDirectYn(item.getDirectYn());
        return dto;
    }).collect(Collectors.toList());
    return VarsqlUtils.getResponseResultItemList(list);
}
Also used : Arrays(java.util.Arrays) Connection(java.sql.Connection) PropertyUtils(org.apache.commons.beanutils.PropertyUtils) DBConnectionRequestDTO(com.varsql.web.dto.db.DBConnectionRequestDTO) LoggerFactory(org.slf4j.LoggerFactory) Autowired(org.springframework.beans.factory.annotation.Autowired) VarsqlUtils(com.varsql.web.util.VarsqlUtils) BeanWrapperImpl(org.springframework.beans.BeanWrapperImpl) DBTypeEntity(com.varsql.web.model.entity.db.DBTypeEntity) DBTypeDriverProviderSpec(com.varsql.web.repository.spec.DBTypeDriverProviderSpec) VarsqlJdbcUtil(com.varsql.core.common.util.VarsqlJdbcUtil) Map(java.util.Map) ConnectionFactory(com.varsql.core.connection.ConnectionFactory) EncryptDecryptException(com.vartech.common.crypto.EncryptDecryptException) SearchParameter(com.vartech.common.app.beans.SearchParameter) Sort(org.springframework.data.domain.Sort) DBTypeEntityRepository(com.varsql.web.repository.db.DBTypeEntityRepository) DBTypeDriverProviderRepository(com.varsql.web.repository.db.DBTypeDriverProviderRepository) JdbcURLFormatParam(com.varsql.core.connection.beans.JdbcURLFormatParam) RequestResultCode(com.vartech.common.constants.RequestResultCode) DBConnectionEntityRepository(com.varsql.web.repository.db.DBConnectionEntityRepository) Set(java.util.Set) ValidationProperty(com.varsql.core.configuration.prop.ValidationProperty) PreparedStatement(java.sql.PreparedStatement) Page(org.springframework.data.domain.Page) Collectors(java.util.stream.Collectors) DBTypeDriverEntity(com.varsql.web.model.entity.db.DBTypeDriverEntity) InvocationTargetException(java.lang.reflect.InvocationTargetException) List(java.util.List) PathType(com.varsql.core.common.constants.PathType) UserService(com.varsql.web.security.UserService) DBTypeDriverEntityRepository(com.varsql.web.repository.db.DBTypeDriverEntityRepository) DBManagerEntityRepository(com.varsql.web.repository.db.DBManagerEntityRepository) JDBCDriverInfo(com.varsql.core.connection.beans.JDBCDriverInfo) BeanUtils(org.springframework.beans.BeanUtils) JdbcDriverLoader(com.varsql.core.common.util.JdbcDriverLoader) ResourceConfigConstants(com.varsql.web.constants.ResourceConfigConstants) JdbcUtils(com.varsql.core.sql.util.JdbcUtils) BeanWrapper(org.springframework.beans.BeanWrapper) HashMap(java.util.HashMap) DBTypeDriverProviderEntity(com.varsql.web.model.entity.db.DBTypeDriverProviderEntity) ResponseResult(com.vartech.common.app.beans.ResponseResult) SecurityUtil(com.varsql.core.common.util.SecurityUtil) HashSet(java.util.HashSet) VartechUtils(com.vartech.common.utils.VartechUtils) CacheManager(org.springframework.cache.CacheManager) Service(org.springframework.stereotype.Service) Qualifier(org.springframework.beans.factory.annotation.Qualifier) DBConnectionMapper(com.varsql.web.model.mapper.db.DBConnectionMapper) FileInfo(com.varsql.core.common.beans.FileInfo) DBConnectionDetailMapper(com.varsql.web.model.mapper.db.DBConnectionDetailMapper) Properties(java.util.Properties) Logger(org.slf4j.Logger) AbstractService(com.varsql.web.common.service.AbstractService) FileServiceUtils(com.varsql.web.util.FileServiceUtils) DBPasswordCryptionFactory(com.varsql.core.crypto.DBPasswordCryptionFactory) StringUtils(com.vartech.common.utils.StringUtils) DBTypeDriverFileEntityRepository(com.varsql.web.repository.db.DBTypeDriverFileEntityRepository) BeansException(org.springframework.beans.BeansException) DBConnectionEntity(com.varsql.web.model.entity.db.DBConnectionEntity) Driver(java.sql.Driver) VarsqlBeanUtils(com.varsql.web.util.VarsqlBeanUtils) DBGroupMappingDbEntityRepository(com.varsql.web.repository.db.DBGroupMappingDbEntityRepository) VarsqlAppCode(com.varsql.core.common.code.VarsqlAppCode) DBTypeDriverProviderResponseDTO(com.varsql.web.dto.db.DBTypeDriverProviderResponseDTO) CacheUtils(com.varsql.web.common.cache.CacheUtils) DBConnectionSpec(com.varsql.web.repository.spec.DBConnectionSpec) Transactional(org.springframework.transaction.annotation.Transactional) DBTypeDriverProviderResponseDTO(com.varsql.web.dto.db.DBTypeDriverProviderResponseDTO) DBTypeDriverProviderEntity(com.varsql.web.model.entity.db.DBTypeDriverProviderEntity) Sort(org.springframework.data.domain.Sort)

Example 3 with SearchParameter

use of com.vartech.common.app.beans.SearchParameter in project varsql by varsqlinfo.

the class UserPreferencesSqlFileController method list.

/**
 * @Method Name  : list
 * @Method 설명 : 목록 .
 * @작성자   : ytkim
 * @작성일   : 2019. 11. 1.
 * @변경이력  :
 * @param req
 * @return
 */
@RequestMapping(value = "/list", method = RequestMethod.POST)
@ResponseBody
public ResponseResult list(@RequestParam(value = "vconnid", required = true) String vconnid, HttpServletRequest req) {
    SearchParameter searchParameter = HttpUtils.getSearchParameter(req);
    searchParameter.addCustomParam(VarsqlParamConstants.UID, SecurityUtil.userViewId(req));
    return userPreferencesSqlFileServiceImpl.sqlFileList(vconnid, searchParameter);
}
Also used : SearchParameter(com.vartech.common.app.beans.SearchParameter) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 4 with SearchParameter

use of com.vartech.common.app.beans.SearchParameter in project varsql by varsqlinfo.

the class DriverProvierMgmtServiceImpl method list.

public ResponseResult list(SearchParameter searchParameter) {
    Sort sort = Sort.by(Sort.Direction.DESC, DBTypeDriverProviderEntity.REG_DT).and(Sort.by(Sort.Direction.DESC, DBTypeDriverProviderEntity.PROVIDER_NAME));
    Page<DBTypeDriverProviderEntity> result = dbTypeDriverProviderRepository.findAll(DBTypeDriverProviderSpec.searchField(searchParameter), VarsqlUtils.convertSearchInfoToPage(searchParameter, sort));
    List<DBTypeDriverProviderResponseDTO> list = result.stream().map(item -> {
        DBTypeDriverProviderResponseDTO dto = new DBTypeDriverProviderResponseDTO();
        dto.setDbType(item.getDbType());
        dto.setProviderName(item.getProviderName());
        dto.setDriverClass(item.getDriverClass());
        dto.setPathType(item.getPathType());
        dto.setDriverProviderId(item.getDriverProviderId());
        return dto;
    }).collect(Collectors.toList());
    return VarsqlUtils.getResponseResult(list, result.getTotalElements(), searchParameter);
}
Also used : JdbcDriverLoader(com.varsql.core.common.util.JdbcDriverLoader) Arrays(java.util.Arrays) ResourceConfigConstants(com.varsql.web.constants.ResourceConfigConstants) DBTypeDriverFileEntity(com.varsql.web.model.entity.db.DBTypeDriverFileEntity) LoggerFactory(org.slf4j.LoggerFactory) VarsqlRuntimeException(com.varsql.core.exception.VarsqlRuntimeException) DBTypeDriverProviderEntity(com.varsql.web.model.entity.db.DBTypeDriverProviderEntity) ResponseResult(com.vartech.common.app.beans.ResponseResult) VarsqlUtils(com.varsql.web.util.VarsqlUtils) FileUtils(com.vartech.common.utils.FileUtils) ArrayList(java.util.ArrayList) DBTypeDriverProviderSpec(com.varsql.web.repository.spec.DBTypeDriverProviderSpec) VartechUtils(com.vartech.common.utils.VartechUtils) UploadFileType(com.varsql.web.constants.UploadFileType) BlankConstants(com.varsql.core.common.constants.BlankConstants) Service(org.springframework.stereotype.Service) EncryptDecryptException(com.vartech.common.crypto.EncryptDecryptException) SearchParameter(com.vartech.common.app.beans.SearchParameter) Sort(org.springframework.data.domain.Sort) FileInfo(com.varsql.core.common.beans.FileInfo) DBTypeDriverProviderRequestDTO(com.varsql.web.dto.db.DBTypeDriverProviderRequestDTO) Path(java.nio.file.Path) DBTypeEntityRepository(com.varsql.web.repository.db.DBTypeEntityRepository) DBTypeDriverProviderRepository(com.varsql.web.repository.db.DBTypeDriverProviderRepository) Logger(org.slf4j.Logger) AbstractService(com.varsql.web.common.service.AbstractService) FileServiceUtils(com.varsql.web.util.FileServiceUtils) StringUtils(com.vartech.common.utils.StringUtils) RequestResultCode(com.vartech.common.constants.RequestResultCode) DBTypeDriverFileEntityRepository(com.varsql.web.repository.db.DBTypeDriverFileEntityRepository) IOException(java.io.IOException) BeansException(org.springframework.beans.BeansException) Page(org.springframework.data.domain.Page) Collectors(java.util.stream.Collectors) DBTypeDriverEntity(com.varsql.web.model.entity.db.DBTypeDriverEntity) InvocationTargetException(java.lang.reflect.InvocationTargetException) List(java.util.List) PathType(com.varsql.core.common.constants.PathType) DBTypeDriverEntityRepository(com.varsql.web.repository.db.DBTypeDriverEntityRepository) MultipartFile(org.springframework.web.multipart.MultipartFile) JDBCDriverInfo(com.varsql.core.connection.beans.JDBCDriverInfo) VarsqlAppCode(com.varsql.core.common.code.VarsqlAppCode) DBTypeDriverProviderResponseDTO(com.varsql.web.dto.db.DBTypeDriverProviderResponseDTO) Transactional(org.springframework.transaction.annotation.Transactional) DBTypeDriverProviderResponseDTO(com.varsql.web.dto.db.DBTypeDriverProviderResponseDTO) DBTypeDriverProviderEntity(com.varsql.web.model.entity.db.DBTypeDriverProviderEntity) Sort(org.springframework.data.domain.Sort)

Example 5 with SearchParameter

use of com.vartech.common.app.beans.SearchParameter in project varsql by varsqlinfo.

the class QnaController method qnaMgmtList.

/**
 * @method  : qnaMgmtList
 * @desc : qna 매니저 목록.
 * @author   : ytkim
 * @date   : 2020. 4. 30.
 * @param req
 * @return
 * @throws Exception
 */
@RequestMapping(value = "/qnaMgmtList", method = RequestMethod.POST)
@ResponseBody
public ResponseResult qnaMgmtList(HttpServletRequest req) throws Exception {
    SearchParameter searchParameter = HttpUtils.getSearchParameter(req);
    searchParameter.addCustomParam(VarsqlParamConstants.ROLE, SecurityUtil.loginRole(req));
    searchParameter.addCustomParam(VarsqlParamConstants.UID, SecurityUtil.userViewId(req));
    return qnaServiceImpl.selectQnaMgmtList(searchParameter);
}
Also used : SearchParameter(com.vartech.common.app.beans.SearchParameter) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

SearchParameter (com.vartech.common.app.beans.SearchParameter)5 FileInfo (com.varsql.core.common.beans.FileInfo)2 VarsqlAppCode (com.varsql.core.common.code.VarsqlAppCode)2 PathType (com.varsql.core.common.constants.PathType)2 JdbcDriverLoader (com.varsql.core.common.util.JdbcDriverLoader)2 JDBCDriverInfo (com.varsql.core.connection.beans.JDBCDriverInfo)2 AbstractService (com.varsql.web.common.service.AbstractService)2 ResourceConfigConstants (com.varsql.web.constants.ResourceConfigConstants)2 DBTypeDriverProviderResponseDTO (com.varsql.web.dto.db.DBTypeDriverProviderResponseDTO)2 DBTypeDriverEntity (com.varsql.web.model.entity.db.DBTypeDriverEntity)2 DBTypeDriverProviderEntity (com.varsql.web.model.entity.db.DBTypeDriverProviderEntity)2 DBTypeDriverEntityRepository (com.varsql.web.repository.db.DBTypeDriverEntityRepository)2 DBTypeDriverFileEntityRepository (com.varsql.web.repository.db.DBTypeDriverFileEntityRepository)2 DBTypeDriverProviderRepository (com.varsql.web.repository.db.DBTypeDriverProviderRepository)2 DBTypeEntityRepository (com.varsql.web.repository.db.DBTypeEntityRepository)2 DBTypeDriverProviderSpec (com.varsql.web.repository.spec.DBTypeDriverProviderSpec)2 FileServiceUtils (com.varsql.web.util.FileServiceUtils)2 VarsqlUtils (com.varsql.web.util.VarsqlUtils)2 ResponseResult (com.vartech.common.app.beans.ResponseResult)2 RequestResultCode (com.vartech.common.constants.RequestResultCode)2