add:飞书接口

This commit is contained in:
zhangzhiqiang
2023-11-06 09:22:37 +08:00
parent 5f9b9e2540
commit ffb118be74

View File

@@ -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
;
}
}