diff --git a/de-xpack b/de-xpack index 122c156b58..25c0bb1ec2 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 122c156b582aed6fb35b18e2292f93f80cd722e7 +Subproject commit 25c0bb1ec2569f54aed498da03732637cbdda727 diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/wecom/api/WecomApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/wecom/api/WecomApi.java new file mode 100644 index 0000000000..04a2ed72dd --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/wecom/api/WecomApi.java @@ -0,0 +1,37 @@ +package io.dataease.api.wecom.api; + +import com.github.xiaoymin.knife4j.annotations.ApiSupport; +import io.dataease.api.wecom.dto.WecomCreator; +import io.dataease.api.wecom.dto.WecomEnableEditor; +import io.dataease.api.wecom.dto.WecomTokenRequest; +import io.dataease.api.wecom.vo.WecomInfoVO; +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; + +@Tag(name = "企微设置") +@ApiSupport(order = 899) +public interface WecomApi { + + @Operation(summary = "查询企微信息") + @GetMapping("/info") + WecomInfoVO info(); + + @Operation(summary = "保存") + @PostMapping("/create") + void save(@RequestBody WecomCreator creator); + + @Operation(summary = "企微token", hidden = true) + @PostMapping("/token") + String wecomToken(@RequestBody WecomTokenRequest request); + + @Operation(summary = "切换开启状态") + @PostMapping("/switchEnable") + void switchEnable(@RequestBody WecomEnableEditor editor); + + @Operation(summary = "验证可用性") + @PostMapping("/validate") + void validate(@RequestBody WecomCreator creator); +} diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/wecom/dto/WecomCreator.java b/sdk/api/api-base/src/main/java/io/dataease/api/wecom/dto/WecomCreator.java new file mode 100644 index 0000000000..581dcd1215 --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/wecom/dto/WecomCreator.java @@ -0,0 +1,22 @@ +package io.dataease.api.wecom.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class WecomCreator implements Serializable { + @Schema(description = "corpId", requiredMode = Schema.RequiredMode.REQUIRED) + private String corpId; + @Schema(description = "agentId", requiredMode = Schema.RequiredMode.REQUIRED) + private String agentId; + @Schema(description = "appSecret", requiredMode = Schema.RequiredMode.REQUIRED) + private String appSecret; + @Schema(description = "回调域名", requiredMode = Schema.RequiredMode.REQUIRED) + private String callBack; + @Schema(description = "是否开启", requiredMode = Schema.RequiredMode.REQUIRED) + private Boolean enable = false; + @Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) + private Boolean valid = false; +} diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/wecom/dto/WecomEnableEditor.java b/sdk/api/api-base/src/main/java/io/dataease/api/wecom/dto/WecomEnableEditor.java new file mode 100644 index 0000000000..bf53b7f88f --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/wecom/dto/WecomEnableEditor.java @@ -0,0 +1,14 @@ +package io.dataease.api.wecom.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Schema(description = "开启状态切换器") +@Data +public class WecomEnableEditor implements Serializable { + + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED) + private boolean enable; +} diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/wecom/dto/WecomTokenRequest.java b/sdk/api/api-base/src/main/java/io/dataease/api/wecom/dto/WecomTokenRequest.java new file mode 100644 index 0000000000..93697a6a0d --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/wecom/dto/WecomTokenRequest.java @@ -0,0 +1,13 @@ +package io.dataease.api.wecom.dto; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class WecomTokenRequest implements Serializable { + + private String code; + + private String state; +} diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/wecom/vo/WecomInfoVO.java b/sdk/api/api-base/src/main/java/io/dataease/api/wecom/vo/WecomInfoVO.java new file mode 100644 index 0000000000..7f6415ef3a --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/wecom/vo/WecomInfoVO.java @@ -0,0 +1,23 @@ +package io.dataease.api.wecom.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Schema(description = "企微信息") +@Data +public class WecomInfoVO implements Serializable { + @Schema(description = "corpId") + private String corpId; + @Schema(description = "agentId") + private String agentId; + @Schema(description = "appSecret") + private String appSecret; + @Schema(description = "回调域名") + private String callBack; + @Schema(description = "是否开启") + private Boolean enable = false; + @Schema(description = "是否可用") + private Boolean valid = false; +}