zhaoyingbo b7437f47e4
All checks were successful
Egg CI/CD / build-image (push) Successful in 49s
Egg CI/CD / deploy (push) Successful in 23s
feat: 优化请求处理 & 拆分Type
2024-06-08 09:15:14 +00:00

38 lines
705 B
TypeScript

import { LarkEvent } from "../../types";
import netTool from "../netTool";
/**
* 请求 CI 监控
*/
const ciMonitor = async (chat_id: string) => {
const URL = `https://ci-monitor.xiaomiwh.cn/ci?chat_id=${chat_id}`;
try {
const res = await netTool.get(URL);
return (res as string) || "";
} catch {
return "";
}
};
/**
* 请求简报收集器
* @param body
* @returns
*/
const reportCollector = async (body: LarkEvent.Data) => {
const URL = "https://report.imoaix.cn/report";
try {
const res = await netTool.post(URL, body);
return (res as string) || "";
} catch {
return "";
}
};
const attach = {
ciMonitor,
reportCollector,
};
export default attach;