zhaoyingbo 09e352a9c1
All checks were successful
Egg Server MIflow / build-image (push) Successful in 1m5s
feat: 抽象网络请求类 & 内容转为ctx向内传递
2024-08-16 09:12:11 +00:00

27 lines
755 B
TypeScript

import { LarkEvent } from "../../types"
import { NetToolBase } from "../../utils/netTool"
class AttachService extends NetToolBase {
/**
* 监控CI状态
* @param {string} chat_id - 聊天ID。
* @returns {Promise<string>} 返回CI监控结果。
*/
async ciMonitor(chat_id: string) {
const URL = `https://ci-monitor.xiaomiwh.cn/gitlab/ci?chat_id=${chat_id}`
return this.get(URL).catch(() => "")
}
/**
* 收集报告数据
* @param {LarkEvent.Data} body - 报告数据。
* @returns {Promise<string>} 返回报告收集结果。
*/
async reportCollector(body: LarkEvent.Data) {
const URL = "https://report.imoaix.cn/report"
return this.post(URL, body).catch(() => "")
}
}
export default AttachService