From 86d3e47f608ab5f7a524ccb576ca951f86b6903b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 2 Jan 2024 14:09:07 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0api=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/api/template/TemplateManageApi.java | 16 +++++++++++++++- .../dataease/api/template/TemplateMarketApi.java | 8 ++++++++ .../api/visualization/DataVisualizationApi.java | 14 ++++++++++++++ .../VisualizationBackgroundApi.java | 2 ++ .../visualization/VisualizationLinkJumpApi.java | 8 ++++++++ .../visualization/VisualizationLinkageApi.java | 8 +++++++- .../api/visualization/VisualizationStoreApi.java | 4 ++++ .../visualization/VisualizationSubjectApi.java | 5 +++++ 8 files changed, 63 insertions(+), 2 deletions(-) diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateManageApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateManageApi.java index 971bda6ae3..8c7f761aed 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateManageApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateManageApi.java @@ -4,42 +4,56 @@ import io.dataease.api.template.dto.TemplateManageDTO; import io.dataease.api.template.request.TemplateManageBatchRequest; import io.dataease.api.template.request.TemplateManageRequest; import io.dataease.api.template.vo.VisualizationTemplateVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.*; import java.util.List; +@Tag(name = "模版管理:基础") public interface TemplateManageApi { @PostMapping("/templateList") - List templateList(@RequestBody TemplateManageRequest request); + @Operation(summary = "模版列表") + List templateList(@RequestBody TemplateManageRequest request); @PostMapping("/save") + @Operation(summary = "保存") TemplateManageDTO save(@RequestBody TemplateManageRequest request); @PostMapping("/delete/{id}/{categoryId}") + @Operation(summary = "删除") void delete(@PathVariable String id,@PathVariable String categoryId); @PostMapping("/deleteCategory/{id}") + @Operation(summary = "删除分类") String deleteCategory(@PathVariable String id); @GetMapping("/findOne/{templateId}") + @Operation(summary = "明细查询") VisualizationTemplateVO findOne(@PathVariable String templateId) throws Exception; @PostMapping("/find") + @Operation(summary = "查询") List find(@RequestBody TemplateManageRequest request); @PostMapping("/findCategories") + @Operation(summary = "分类明细查询") List findCategories(@RequestBody TemplateManageRequest request); @PostMapping("/nameCheck") + @Operation(summary = "模版名称校验") String nameCheck(@RequestBody TemplateManageRequest request); @PostMapping("/categoryTemplateNameCheck") + @Operation(summary = "分类名称校验") String categoryTemplateNameCheck(@RequestBody TemplateManageRequest request); @PostMapping("/batchUpdate") + @Operation(summary = "批量更新") void batchUpdate(@RequestBody TemplateManageBatchRequest request); @PostMapping("/batchDelete") + @Operation(summary = "批量删除") void batchDelete(@RequestBody TemplateManageBatchRequest request); } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateMarketApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateMarketApi.java index 386f2316f1..f8f4c21321 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateMarketApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateMarketApi.java @@ -4,6 +4,8 @@ import io.dataease.api.template.request.TemplateMarketSearchRequest; import io.dataease.api.template.response.MarketBaseResponse; import io.dataease.api.template.response.MarketPreviewBaseResponse; import io.dataease.api.template.vo.MarketMetaDataVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -14,20 +16,26 @@ import java.util.List; * @author : WangJiaHao * @date : 2023/11/6 17:23 */ +@Tag(name = "模版中心:基础") public interface TemplateMarketApi { @GetMapping("/search") + @Operation(summary = "查询") MarketBaseResponse searchTemplate(); @GetMapping("/searchRecommend") + @Operation(summary = "查询基础信息") MarketBaseResponse searchTemplateRecommend(); @GetMapping("/searchPreview") + @Operation(summary = "预览") MarketPreviewBaseResponse searchTemplatePreview(); @GetMapping("/categories") + @Operation(summary = "分类") List categories(); @GetMapping("/categoriesObject") + @Operation(summary = "分类明细") List categoriesObject() ; } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/DataVisualizationApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/DataVisualizationApi.java index b024ddd5cc..dc3eb2062b 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/DataVisualizationApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/DataVisualizationApi.java @@ -11,6 +11,7 @@ import io.dataease.auth.DeApiPath; import io.dataease.auth.DePermit; import io.dataease.model.BusiNodeRequest; import io.dataease.model.BusiNodeVO; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -30,43 +31,54 @@ public interface DataVisualizationApi { */ @GetMapping("/findById/{dvId}/{busiFlag}") @DePermit(value = {"#p0+':read'"}, busiFlag = "#p1") + @Operation(summary = "查询可视化资源") DataVisualizationVO findById(@PathVariable("dvId") Long dvId,@PathVariable("busiFlag") String busiFlag); @PostMapping("/saveCanvas") @DePermit(value = {"#p0.pid + ':manage'"}, busiFlag = "#p0.type") + @Operation(summary = "画布保存") String saveCanvas(@RequestBody DataVisualizationBaseRequest request); @PostMapping("/updateCanvas") @DePermit(value = {"#p0.id + ':manage'"}, busiFlag = "#p0.type") + @Operation(summary = "画布更新") void updateCanvas(@RequestBody DataVisualizationBaseRequest request); @PostMapping("/updateBase") @DePermit(value = {"#p0.id + ':manage'"}, busiFlag = "#p0.type") + @Operation(summary = "可视化资源基础信息更新") void updateBase(@RequestBody DataVisualizationBaseRequest request); @DeleteMapping("/deleteLogic/{dvId}/{busiFlag}") @DePermit(value = {"#p0+':manage'"}, busiFlag = "#p1") + @Operation(summary = "可视化资源删除") void deleteLogic(@PathVariable("dvId") Long dvId,@PathVariable("busiFlag") String busiFlag); @PostMapping("/tree") + @Operation(summary = "查询可视化资源树") List tree(@RequestBody BusiNodeRequest request); @PostMapping("/move") @DePermit(value = {"#p0.id+':manage'", "#p0.pid+':manage'"}, busiFlag = "#p0.type") + @Operation(summary = "移动可视化资") void move(@RequestBody DataVisualizationBaseRequest request); @PostMapping("/nameCheck") + @Operation(summary = "名称校验") void nameCheck(@RequestBody DataVisualizationBaseRequest request); @PostMapping("/findRecent") + @Operation(summary = "查询最近操作资源") List findRecent(@RequestBody VisualizationWorkbranchQueryRequest request); @PostMapping("/copy") @JsonSerialize(using = ToStringSerializer.class) @DePermit(value = {"#p0.id+':manage'", "#p0.pid+':manage'"}, busiFlag = "#p0.type") + @Operation(summary = "复制") String copy(@RequestBody DataVisualizationBaseRequest request); @GetMapping("/findDvType/{dvId}") + @Operation(summary = "查询可视化资源类型") String findDvType(@PathVariable("dvId")Long dvId); /** @@ -75,6 +87,7 @@ public interface DataVisualizationApi { * @return */ @PostMapping("/decompression") + @Operation(summary = "解析可视化资源模板信息") DataVisualizationVO decompression(@RequestBody DataVisualizationBaseRequest request) throws Exception; /** @@ -83,6 +96,7 @@ public interface DataVisualizationApi { * @return */ @PostMapping("/decompressionLocalFile") + @Operation(summary = "解析可视化资源模板文件信息") DataVisualizationVO decompressionLocalFile(@RequestPart(value = "file") MultipartFile file); } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationBackgroundApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationBackgroundApi.java index f8f32009be..7a233f6325 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationBackgroundApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationBackgroundApi.java @@ -3,6 +3,7 @@ package io.dataease.api.visualization; import com.github.xiaoymin.knife4j.annotations.ApiSupport; import io.dataease.api.visualization.request.VisualizationBackgroundRequest; import io.dataease.api.visualization.vo.VisualizationBackgroundVO; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; @@ -18,5 +19,6 @@ import java.util.Map; @ApiSupport(order = 997) public interface VisualizationBackgroundApi { @GetMapping("/findAll") + @Operation(summary = "背景信息查询") Map> findAll(); } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkJumpApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkJumpApi.java index 8dae8ee4a2..8410e7eac1 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkJumpApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkJumpApi.java @@ -6,6 +6,7 @@ import io.dataease.api.visualization.request.VisualizationLinkJumpBaseRequest; import io.dataease.api.visualization.response.VisualizationLinkJumpBaseResponse; import io.dataease.api.visualization.vo.VisualizationViewTableVO; import io.dataease.dto.dataset.DatasetTableFieldDTO; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -24,23 +25,30 @@ public interface VisualizationLinkJumpApi { @GetMapping("/getTableFieldWithViewId/{viewId}") + @Operation(summary = "查询可跳转字段信息") List getTableFieldWithViewId(@PathVariable Long viewId); @GetMapping("/queryWithViewId/{dvId}/{viewId}") + @Operation(summary = "根据视图ID查询跳转信息") VisualizationLinkJumpDTO queryWithViewId(@PathVariable Long dvId, @PathVariable Long viewId); @GetMapping("/queryVisualizationJumpInfo/{dvId}") + @Operation(summary = "根据可视化资源ID查询跳转信息") VisualizationLinkJumpBaseResponse queryVisualizationJumpInfo(@PathVariable Long dvId); @PostMapping("/updateJumpSet") + @Operation(summary = "更新跳转信息") void updateJumpSet(@RequestBody VisualizationLinkJumpDTO jumpDTO); @PostMapping("/queryTargetVisualizationJumpInfo") + @Operation(summary = "查询目标跳转信息") VisualizationLinkJumpBaseResponse queryTargetVisualizationJumpInfo(@RequestBody VisualizationLinkJumpBaseRequest request); @GetMapping("/viewTableDetailList/{dvId}") + @Operation(summary = "查询跳转明细") List viewTableDetailList(@PathVariable Long dvId); @PostMapping("/updateJumpSetActive") + @Operation(summary = "更新跳转信息可用状态") VisualizationLinkJumpBaseResponse updateJumpSetActive(@RequestBody VisualizationLinkJumpBaseRequest request); } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkageApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkageApi.java index a54c261972..9d88f567e9 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkageApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkageApi.java @@ -3,6 +3,7 @@ package io.dataease.api.visualization; import com.github.xiaoymin.knife4j.annotations.ApiSupport; import io.dataease.api.commons.BaseRspModel; import io.dataease.api.visualization.request.VisualizationLinkageRequest; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -17,24 +18,29 @@ import java.util.Map; * @date : 2023/7/13 */ -@Tag(name = "可视化管理:链接") +@Tag(name = "可视化管理:联动") @ApiSupport(order = 996) public interface VisualizationLinkageApi { @PostMapping("/getViewLinkageGather") + @Operation(summary = "查询联动信息") Map getViewLinkageGather(@RequestBody VisualizationLinkageRequest request); @PostMapping("/getViewLinkageGatherArray") + @Operation(summary = "查询联动信息数组") List getViewLinkageGatherArray(@RequestBody VisualizationLinkageRequest request); @PostMapping("/saveLinkage") + @Operation(summary = "保存联动信息") BaseRspModel saveLinkage(@RequestBody VisualizationLinkageRequest request); @GetMapping("/getVisualizationAllLinkageInfo/{dvId}") + @Operation(summary = "根据资源ID查询联动信息") Map> getVisualizationAllLinkageInfo(@PathVariable Long dvId); @PostMapping("/updateLinkageActive") + @Operation(summary = "修改联动信息可用状态") Map updateLinkageActive(@RequestBody VisualizationLinkageRequest request); } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationStoreApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationStoreApi.java index cd8b8957b5..62cea98633 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationStoreApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationStoreApi.java @@ -4,6 +4,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport; import io.dataease.api.visualization.request.VisualizationStoreRequest; import io.dataease.api.visualization.request.VisualizationWorkbranchQueryRequest; import io.dataease.api.visualization.vo.VisualizationStoreVO; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -17,10 +18,13 @@ import java.util.List; public interface VisualizationStoreApi { @PostMapping("/execute") + @Operation(summary = "变更收藏信息") void execute(@RequestBody VisualizationStoreRequest request); @PostMapping("/query") + @Operation(summary = "查询收藏资源信息") List query(@RequestBody VisualizationWorkbranchQueryRequest request); @GetMapping("/favorited/{id}") + @Operation(summary = "收藏") boolean favorited(@PathVariable("id") Long id); } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationSubjectApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationSubjectApi.java index e9918f9e88..09775d4280 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationSubjectApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationSubjectApi.java @@ -3,6 +3,7 @@ package io.dataease.api.visualization; import com.github.xiaoymin.knife4j.annotations.ApiSupport; import io.dataease.api.visualization.request.VisualizationSubjectRequest; import io.dataease.api.visualization.vo.VisualizationSubjectVO; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.*; @@ -13,15 +14,19 @@ import java.util.List; public interface VisualizationSubjectApi { @PostMapping("/query") + @Operation(summary = "查询") List query(@RequestBody VisualizationSubjectRequest request); @PostMapping("/querySubjectWithGroup") + @Operation(summary = "分组查询") List querySubjectWithGroup(@RequestBody VisualizationSubjectRequest request); @PostMapping("/update") + @Operation(summary = "更新") void update(@RequestBody VisualizationSubjectRequest request); @DeleteMapping("/delete/{id}") + @Operation(summary = "删除") void delete(@PathVariable String id); }