zhaoyingbo 18a95387ee
All checks were successful
CI Monitor CI/CD / build-image (push) Successful in 33s
CI Monitor CI/CD / deploy (push) Successful in 37s
chore: 更新lint-staged和commitlint配置
2024-07-25 01:09:24 +00:00

23 lines
618 B
TypeScript

import manageRobot from "../../controllers/manageRobot"
import netTool from "../../service/netTool"
/**
* 处理管理CI监视器的请求。
* @param req - 请求对象。
* @returns 响应对象。
*/
export const manageCIMonitorReq = (req: Request) => {
const url = new URL(req.url)
if (url.pathname === "/ci") {
const chat_id = url.searchParams.get("chat_id")
if (!chat_id) return netTool.badRequest("chat_id is required!")
manageRobot.sendCIReportByChatId(chat_id)
return Response.json({
code: 0,
msg: "success",
data: "reporting...",
})
}
return netTool.ok()
}