diff --git a/de-xpack b/de-xpack index 50699c9a2b..188b57250c 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 50699c9a2be31a1896e3d355013bbc0c1c20cd6a +Subproject commit 188b57250c4220e1972ee15da0bf416d6ce3e1fc diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/communicate/api/CommunicateApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/communicate/api/CommunicateApi.java new file mode 100644 index 0000000000..58ad7f2631 --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/communicate/api/CommunicateApi.java @@ -0,0 +1,13 @@ +package io.dataease.api.communicate.api; + +import io.dataease.api.communicate.dto.MessageDTO; +import io.swagger.v3.oas.annotations.Hidden; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +@Hidden +public interface CommunicateApi { + + @PostMapping("/send") + void send(@RequestBody MessageDTO dto); +} diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/communicate/dto/MessageDTO.java b/sdk/api/api-base/src/main/java/io/dataease/api/communicate/dto/MessageDTO.java new file mode 100644 index 0000000000..a2d78970b9 --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/communicate/dto/MessageDTO.java @@ -0,0 +1,27 @@ +package io.dataease.api.communicate.dto; + +import io.dataease.constant.MessageEnum; +import lombok.Data; + +import java.io.File; +import java.io.Serial; +import java.io.Serializable; +import java.util.List; + +@Data +public class MessageDTO implements Serializable { + @Serial + private static final long serialVersionUID = -1499402825211940277L; + + private List recipientList; + + private String title; + + private byte[] content; + + private List fileList; + + private List messageFileList; + + private MessageEnum messageEnum; +} diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/communicate/dto/MessageFile.java b/sdk/api/api-base/src/main/java/io/dataease/api/communicate/dto/MessageFile.java new file mode 100644 index 0000000000..1e93515a30 --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/communicate/dto/MessageFile.java @@ -0,0 +1,17 @@ +package io.dataease.api.communicate.dto; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +@Data +public class MessageFile implements Serializable { + @Serial + private static final long serialVersionUID = 7140452847688399889L; + + private String fileName; + + private byte[] body; + +} diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/email/EmailApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/email/EmailApi.java index 7baaf4677e..13823f59dc 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/email/EmailApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/email/EmailApi.java @@ -1,9 +1,7 @@ package io.dataease.api.email; import com.github.xiaoymin.knife4j.annotations.ApiSupport; -import io.dataease.api.email.dto.EmailDTO; import io.dataease.api.system.vo.SettingItemVO; -import io.swagger.v3.oas.annotations.Hidden; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.GetMapping; @@ -28,7 +26,4 @@ public interface EmailApi { @PostMapping("/setting/validate") void validate(@RequestBody List settingItemVOS); - @PostMapping("/send") - @Hidden - void send(@RequestBody EmailDTO dto); } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/email/dto/EmailDTO.java b/sdk/api/api-base/src/main/java/io/dataease/api/email/dto/EmailDTO.java deleted file mode 100644 index e78eaf6e03..0000000000 --- a/sdk/api/api-base/src/main/java/io/dataease/api/email/dto/EmailDTO.java +++ /dev/null @@ -1,35 +0,0 @@ -package io.dataease.api.email.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.apache.commons.collections4.CollectionUtils; - -import java.io.File; -import java.io.Serial; -import java.io.Serializable; -import java.util.List; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class EmailDTO implements Serializable { - @Serial - private static final long serialVersionUID = 3599154848839436838L; - - private List recipientList; - - private String from; - - private String subject; - - private byte[] content; - - private List fileList; - - private List emailFiles; - - public boolean existFile() { - return CollectionUtils.isNotEmpty(fileList) || CollectionUtils.isNotEmpty(emailFiles); - } -} diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/email/dto/EmailFile.java b/sdk/api/api-base/src/main/java/io/dataease/api/email/dto/EmailFile.java deleted file mode 100644 index e8e819e0c6..0000000000 --- a/sdk/api/api-base/src/main/java/io/dataease/api/email/dto/EmailFile.java +++ /dev/null @@ -1,16 +0,0 @@ -package io.dataease.api.email.dto; - -import lombok.Data; - -import java.io.Serial; -import java.io.Serializable; - -@Data -public class EmailFile implements Serializable { - @Serial - private static final long serialVersionUID = -3898069299109267651L; - - private String fileName; - - private byte[] fileByte; -} diff --git a/sdk/common/src/main/java/io/dataease/constant/MessageEnum.java b/sdk/common/src/main/java/io/dataease/constant/MessageEnum.java new file mode 100644 index 0000000000..8b11ef3706 --- /dev/null +++ b/sdk/common/src/main/java/io/dataease/constant/MessageEnum.java @@ -0,0 +1,28 @@ +package io.dataease.constant; + +import java.util.Arrays; + +public enum MessageEnum { + + INNER(0), EMAIL(1), WECOM(2), DINGTALK(3), LARK(4), LARKSUITE(5); + private Integer flag; + + public Integer getFlag() { + return flag; + } + + public void setFlag(Integer flag) { + this.flag = flag; + } + + MessageEnum(Integer flag) { + this.flag = flag; + } + + MessageEnum() { + } + + public static MessageEnum fromValue(Integer flag) { + return Arrays.stream(values()).filter(v -> v.flag.equals(flag)).findFirst().get(); + } +}