Merge pull request #7239 from dataease/pr@dev-v2@perf_api_doc_sys

perf: 系统设置api接口文档
This commit is contained in:
fit2cloud-chenyw 2023-12-20 17:57:29 +08:00 committed by GitHub
commit 055ff852b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 61 additions and 12 deletions

View File

@ -63,3 +63,4 @@ knife4j:
enable: true
setting:
language: zh_cn
enable-swagger-models: false

View File

@ -1,18 +1,23 @@
package io.dataease.api.map;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.api.map.dto.GeometryNodeCreator;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
@Tag(name = "地理信息")
@Tag(name = "系统设置:地理信息")
@ApiSupport(order = 798)
public interface GeoApi {
@Operation(summary = "保存地理信息")
@PostMapping(value = "/save", consumes = {"multipart/form-data"})
void saveMapGeo(@RequestPart("request") GeometryNodeCreator request, @RequestPart(value = "file") MultipartFile file);
@Operation(summary = "删除地理信息")
@PostMapping("/delete/{id}")
void deleteGeo(@PathVariable("id") String id);
}

View File

@ -1,17 +1,21 @@
package io.dataease.api.map;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.api.map.vo.AreaNode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
@Tag(name = "地图")
@Tag(name = "系统设置:地图区域")
@ApiSupport(order = 797)
public interface MapApi {
/**
* 获取世界树
* @return
*/
@Operation(summary = "查询区域树")
@GetMapping("/worldTree")
AreaNode getWorldTree();
}

View File

@ -1,15 +1,17 @@
package io.dataease.api.map.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@Schema(description = "地理信息构造器")
@Data
public class GeometryNodeCreator implements Serializable {
@Schema(description = "区域代码")
private String code;
@Schema(description = "区域名称")
private String name;
@Schema(description = "上级区域代码")
private String pid;
}

View File

@ -1,6 +1,7 @@
package io.dataease.api.map.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
@ -8,23 +9,31 @@ import java.io.Serial;
import java.io.Serializable;
import java.util.List;
@Schema(description = "区域节点")
@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AreaNode implements Serializable {
@Serial
private static final long serialVersionUID = -2285934203102231711L;
@Schema(description = "ID")
private String id;
@Schema(description = "级别")
private String level;
@Schema(description = "名称")
private String name;
@Schema(description = "上级ID")
private String pid;
@Schema(description = "是否自定义节点")
private boolean custom = false;
/**
* 国家代码
*/
@Schema(description = "国家代码")
private String country;
/**
* 下属区域
*/
@Schema(description = "子集")
private List<AreaNode> children;
}

View File

@ -1,7 +1,12 @@
package io.dataease.api.system;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.api.system.request.OnlineMapEditor;
import io.dataease.api.system.vo.SettingItemVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -9,20 +14,28 @@ import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@Tag(name = "系统设置:系统参数")
@ApiSupport(order = 799)
public interface SysParameterApi {
@Operation(summary = "查询单个配置值")
@Parameter(name = "key", description = "配置key", required = true, in = ParameterIn.PATH)
@GetMapping("/singleVal/{key}")
String singleVal(@PathVariable("key") String key);
@Operation(summary = "保存在线地图")
@PostMapping("/saveOnlineMap")
void saveOnlineMap(@RequestBody OnlineMapEditor editor);
@Operation(summary = "查询在线地图")
@GetMapping("/queryOnlineMap")
String queryOnlineMap();
@Operation(summary = "查询基础设置(非xpack)")
@GetMapping("basic/query")
List<SettingItemVO> queryBasicSetting();
@Operation(summary = "保存基础设置(非xpack)")
@PostMapping("/basic/save")
void saveBasicSetting(@RequestBody List<SettingItemVO> settingItemVOS);

View File

@ -1,11 +1,13 @@
package io.dataease.api.system.request;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@Schema(description = "在线地图构造器")
@Data
public class OnlineMapEditor implements Serializable {
@Schema(description = "在线地图key", requiredMode = Schema.RequiredMode.REQUIRED)
private String key;
}

View File

@ -1,19 +1,21 @@
package io.dataease.api.system.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Schema(description = "基础设置参数项")
@Data
@NoArgsConstructor
public class SettingItemVO implements Serializable {
@Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED)
private String pkey;
@Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED)
private String pval;
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED)
private String type;
@Schema(description = "顺序", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer sort;
}

View File

@ -69,15 +69,26 @@ public class SwaggerConfig {
return GroupedOpenApi.builder().group("4-datasource").displayName("数据源管理").packagesToScan("io.dataease.datasource").build();
}
@Bean
public GroupedOpenApi basicSettingApi() {
String[] packageArray = {
"io.dataease.system",
"io.dataease.map",
};
return GroupedOpenApi.builder().group("5-xpackpermission").displayName("系统设置").packagesToScan(packageArray).build();
}
@Bean
public GroupedOpenApi baseXpackApi() {
return GroupedOpenApi.builder().group("5-xpackbase").displayName("基础xpack").packagesToScan("io.dataease.xpack.base").build();
return GroupedOpenApi.builder().group("6-xpackbase").displayName("基础xpack").packagesToScan("io.dataease.xpack.base").build();
}
@Bean
public GroupedOpenApi systemApi() {
return GroupedOpenApi.builder().group("6-xpackpermission").displayName("权限相关xpack").packagesToScan("io.dataease.xpack.permissions").build();
return GroupedOpenApi.builder().group("7-xpackpermission").displayName("权限相关xpack").packagesToScan("io.dataease.xpack.permissions").build();
}
}