feat: 新增某人可见接口
All checks were successful
Egg CI/CD / build-image (push) Successful in 28s
Egg CI/CD / deploy (push) Successful in 20s

This commit is contained in:
zhaoyingbo 2024-03-09 09:01:01 +00:00
parent b5522acd20
commit 1f1d1f9d1c

View File

@ -39,7 +39,6 @@ const getHeaders = async () => {
* @param {string} receive_id IDID类型应与查询参数receive_id_type
* @param {MsgType} msg_type textpostimagefileaudiomediastickerinteractiveshare_chatshare_user
* @param {string} content JSON结构序列化后的字符串msg_type对应不同内容
* @returns {string} id
*/
export const sendMsg = async (
receive_id_type: ReceiveIDType,
@ -61,7 +60,7 @@ export const sendMsg = async (
/**
*
* @param {string} message_id id
* @param {*} content JSON结构序列化后的字符串msg_type对应不同内容
* @param {string} content JSON结构序列化后的字符串msg_type对应不同内容
*/
export const updateCard = async (message_id: string, content: string) => {
const URL = `https://open.f.mioffice.cn/open-apis/im/v1/messages/${message_id}`;
@ -74,3 +73,43 @@ export const updateCard = async (message_id: string, content: string) => {
})
);
};
/**
*
* @param {string} chat_id ID
* @param {string} open_id ID
* @param {MsgType} msg_type textpostimagefileaudiomediastickerinteractiveshare_chatshare_user
* @param {*} card String
*/
export const sendEphemeralMsg = async (
chat_id: string,
open_id: string,
msg_type: MsgType,
card: any
) => {
const URL = `https://open.f.mioffice.cn/open-apis/ephemeral/v1/send`;
const headers = await getHeaders();
return await manageFetch(() =>
fetch(URL, {
method: "POST",
headers,
body: JSON.stringify({ chat_id, open_id, msg_type, card }),
})
);
};
/**
*
* @param message_id id
*/
export const delEphemeralMsg = async (message_id: string) => {
const URL = `https://open.f.mioffice.cn/open-apis/ephemeral/v1/delete`;
const headers = await getHeaders();
return await manageFetch(() =>
fetch(URL, {
method: "POST",
headers,
body: JSON.stringify({ message_id }),
})
);
};