From 47a2c414f6a7c5b9876d1320896cf8a79ebd7225 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 11 Aug 2022 10:49:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E4=B8=BB=E9=A2=98):=20=E5=A2=9E=E5=8A=A0=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEapi=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/plugins/server/ThemeServer.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/dataease/plugins/server/ThemeServer.java b/backend/src/main/java/io/dataease/plugins/server/ThemeServer.java index 497f6d79e1..d272501124 100644 --- a/backend/src/main/java/io/dataease/plugins/server/ThemeServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/ThemeServer.java @@ -2,6 +2,8 @@ package io.dataease.plugins.server; import java.util.List; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ObjectUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.web.bind.annotation.PathVariable; @@ -21,11 +23,12 @@ import io.dataease.plugins.xpack.theme.dto.ThemeRequest; import io.dataease.plugins.xpack.theme.service.ThemeXpackService; import springfox.documentation.annotations.ApiIgnore; -@ApiIgnore +@Api(tags = "xpack:系统主题") @RequestMapping("/plugin/theme") @RestController public class ThemeServer { + @ApiOperation("查询所有") @PostMapping("/themes") public List themes() { @@ -33,12 +36,14 @@ public class ThemeServer { return themeXpackService.themes(); } + @ApiOperation("查询配置项") @PostMapping("/items/{themeId}") public List themeItems(@PathVariable("themeId") int themeId) { ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class); return themeXpackService.queryItems(themeId); } + @ApiOperation("保存") @RequiresPermissions("sysparam:read") @PostMapping("/save") public void save(@RequestBody ThemeCreateRequest request) { @@ -55,9 +60,10 @@ public class ThemeServer { DEException.throwException(e); } } - + } - + + @ApiOperation("重命名") @PostMapping("/rename") public void renameTheme(@RequestBody ThemeRenameRequest request) { if (request.getId() < 3) { @@ -76,21 +82,24 @@ public class ThemeServer { DEException.throwException(e); } } - + } + @ApiOperation("切换高级开关") @PostMapping("/enableSenior/{themeId}") public void enableSenior(@PathVariable("themeId") Integer themeId) { ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class); themeXpackService.switchSenior(themeId); } + @ApiOperation("应用") @PostMapping("/activeTheme/{themeId}") public void activeTheme(@PathVariable("themeId") Integer themeId) { ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class); themeXpackService.switchStatus(themeId); } + @ApiOperation("删除") @RequiresPermissions("sysparam:read") @PostMapping("/delete/{themeId}") public void delete(@PathVariable("themeId") int themeId) { @@ -98,6 +107,7 @@ public class ThemeServer { themeXpackService.deleteTheme(themeId); } + @ApiOperation("保存配置项") @PostMapping("/saveThemeItems") public void saveThemeItems(@RequestBody ThemeRequest request) { ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class);