diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/common/utils/MsgUtil.java b/mes/hd/nladmin-system/src/main/java/org/nl/common/utils/MsgUtil.java new file mode 100644 index 00000000..05c797a6 --- /dev/null +++ b/mes/hd/nladmin-system/src/main/java/org/nl/common/utils/MsgUtil.java @@ -0,0 +1,32 @@ +package org.nl.common.utils; + +import cn.hutool.http.HttpRequest; +import cn.hutool.json.JSON; +import cn.hutool.json.JSONObject; + +/* + * @author ZZQ + * @Date 2023/11/2 15:02 + */ +public class MsgUtil { + private static String FS_URL = "https://open.feishu.cn/open-apis/bot/v2/hook/cfe495f7-9bcd-40bb-ab66-038de2131cac"; + public static void sendMsg(String msg, MsgSend msgType){ + switch (msgType){ + case FS: + JSONObject body = new JSONObject(); + body.set("msg_type","text"); + body.set("content",MapOf.of("text",msg)); + String resultMsg = HttpRequest.post(FS_URL) + .body(body.toString()) + .execute().body(); + case EMAIL: + default:; + } + } + public enum MsgSend{ + FS, + EMAIL + ; + } +} +