add:飞书接口
This commit is contained in:
@@ -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
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user