ProjectUsedByTenantController.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package cn.cslg.pas.controller;
  2. import cn.cslg.pas.common.core.base.Constants;
  3. import cn.cslg.pas.common.model.vo.ProjectSharedTenantVO;
  4. import cn.cslg.pas.common.model.vo.ProjectUsedByTenantVO;
  5. import cn.cslg.pas.service.ProjectUsedByTenantService;
  6. import io.swagger.v3.oas.annotations.Operation;
  7. import io.swagger.v3.oas.annotations.tags.Tag;
  8. import lombok.RequiredArgsConstructor;
  9. import org.springframework.context.annotation.Lazy;
  10. import org.springframework.web.bind.annotation.*;
  11. import java.io.IOException;
  12. import java.util.List;
  13. /**
  14. * @Author xiexiang
  15. * @Date 2023/7/28
  16. */
  17. @Tag(name = "导出报表外部接口")
  18. @CrossOrigin
  19. @RestController
  20. @RequestMapping(Constants.API_VERSION_V2 + "/usedByTenant")
  21. @RequiredArgsConstructor(onConstructor_ = {@Lazy})
  22. public class ProjectUsedByTenantController {
  23. private final ProjectUsedByTenantService projectUsedByTenantService;
  24. @Operation(summary = "查询")
  25. @PostMapping("/query")
  26. public List<ProjectUsedByTenantVO> projectUsedByTenant(@RequestBody List<Integer> tenantIds) throws IOException {
  27. return projectUsedByTenantService.getProjectUsedByTenant(tenantIds);
  28. }
  29. @Operation(summary = "租户被分享专题库")
  30. @PostMapping("/projectShared")
  31. public List<ProjectSharedTenantVO> projectShared(@RequestBody List<Integer> tenantIds) throws IOException {
  32. return projectUsedByTenantService.projectShared(tenantIds);
  33. }
  34. }