ViewService.java 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * <<
  3. * Davinci
  4. * ==
  5. * Copyright (C) 2016 - 2019 EDP
  6. * ==
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. * >>
  17. *
  18. */
  19. package edp.davinci.service;
  20. import edp.core.exception.NotFoundException;
  21. import edp.core.exception.ServerException;
  22. import edp.core.exception.UnAuthorizedException;
  23. import edp.core.model.Paginate;
  24. import edp.core.model.PaginateWithQueryColumns;
  25. import edp.davinci.core.model.SqlEntity;
  26. import edp.davinci.core.service.CheckEntityService;
  27. import edp.davinci.dto.viewDto.*;
  28. import edp.davinci.model.SqlVariable;
  29. import edp.davinci.model.User;
  30. import edp.davinci.model.View;
  31. import edp.davinci.service.excel.SQLContext;
  32. import java.sql.SQLException;
  33. import java.util.List;
  34. import java.util.Map;
  35. import java.util.Set;
  36. public interface ViewService extends CheckEntityService {
  37. List<ViewExt> getAllViews() throws NotFoundException, UnAuthorizedException, ServerException;
  38. List<ViewBaseInfo> getViews(Long projectId, User user) throws NotFoundException, UnAuthorizedException, ServerException;
  39. ViewWithSourceBaseInfo createView(ViewCreate viewCreate, User user) throws NotFoundException, UnAuthorizedException, ServerException;
  40. boolean updateView(ViewUpdate viewUpdate, User user) throws NotFoundException, UnAuthorizedException, ServerException;
  41. boolean deleteView(Long id, User user) throws NotFoundException, UnAuthorizedException, ServerException;
  42. PaginateWithQueryColumns executeSql(ViewExecuteSql executeSql, User user) throws NotFoundException, UnAuthorizedException, ServerException;
  43. Paginate<Map<String, Object>> getData(Long id, ViewExecuteParam executeParam, User user) throws NotFoundException, UnAuthorizedException, ServerException, SQLException;
  44. PaginateWithQueryColumns getResultDataList(boolean isMaintainer, ViewWithSource viewWithSource, ViewExecuteParam executeParam, User user) throws ServerException, SQLException;
  45. List<Map<String, Object>> getDistinctValue(Long id, DistinctParam param, User user) throws NotFoundException, ServerException, UnAuthorizedException;
  46. List getDistinctValueData(boolean isMaintainer, ViewWithSource viewWithSource, DistinctParam param, User user) throws ServerException;
  47. ViewWithSourceBaseInfo getView(Long id, User user) throws NotFoundException, UnAuthorizedException, ServerException;
  48. List<ViewBaseInfo> getViewBaseInfoByParentId(Long projectId, Long parentId, User user) throws NotFoundException, UnAuthorizedException, ServerException;
  49. SQLContext getSQLContext(boolean isMaintainer, ViewWithSource viewWithSource, ViewExecuteParam executeParam, User user);
  50. void packageParams(boolean isProjectMaintainer, Long viewId, SqlEntity sqlEntity, List<SqlVariable> variables, List<Param> paramList, Set<String> excludeColumns, User user);
  51. }