feat: 消息转发接口支持同时指定多个接受者 #24

Merged
zhaoyingbo merged 3 commits from feat/multi-sender into master 2024-07-26 07:16:36 +00:00
2 changed files with 19 additions and 13 deletions

View File

@ -1,5 +1,8 @@
name: Egg CI/CD
on: [push]
on:
push:
branches:
- master
jobs:
build-image:

View File

@ -109,19 +109,22 @@ export const manageMessageReq = async (req: Request) => {
if (email) email.map(makeSendFunc("email"))
}
// 如果有receive_id则发送给所有receive_id中的人
if (body.receive_id && body.receive_id_type) {
sendList.push(
service.lark.message
.send(appName)(
body.receive_id_type,
body.receive_id,
body.msg_type,
finalContent
)
.then((res) => {
sendRes[body.receive_id_type][body.receive_id] = res
})
)
body.receive_id.split(",").forEach((receive_id) => {
sendList.push(
service.lark.message
.send(appName)(
body.receive_id_type,
receive_id,
body.msg_type,
finalContent
)
.then((res) => {
sendRes[body.receive_id_type][receive_id] = res
})
)
})
}
try {