From ffb118be746ee57616882eb6399a09263031ae72 Mon Sep 17 00:00:00 2001 From: zhangzhiqiang Date: Mon, 6 Nov 2023 09:22:37 +0800 Subject: [PATCH] =?UTF-8?q?add:=E9=A3=9E=E4=B9=A6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/nl/common/utils/MsgUtil.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 mes/hd/nladmin-system/src/main/java/org/nl/common/utils/MsgUtil.java 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 + ; + } +} +