import { ApiClientFactory } from '../core/api.client.factory'; import { AlgoGroup, AlgoDisplayReq, AlgoDisplayList, AlgoDetailReq, AlgoDetailList, AlgoBoardStatis, AlgoStatisticsTrend, AccuracyRateStatistics, OneAlgoStatisticsTrend, } from '../model/AlgoView.model'; export class AlgoViewService { constructor(private factory: ApiClientFactory) {} /** * 获取算法分组 * @param projectId * @returns */ async loadAlgoGroup(): Promise { const result = await this.factory.amis.get(`/boss/algoBoard/algoGroup`); return result; } /** * 保存算法看板 * @param options * @returns */ async saveAlgoDisplay(options: AlgoDisplayReq): Promise { const result = await this.factory.amis.post(`/boss/algoBoard`, options); return result; } /** * 删除算法看板 * @param id * @returns */ async deleAlgoDisplay(id: string): Promise { const result = await this.factory.amis.delete(`/boss/algoBoard/${id}`); return result; } /** * 获取算法看板列表 * @returns */ async loadAlgoDisplayList(): Promise { const result = await this.factory.amis.get(`/boss/algoBoard/list`); return result; } /** * 保存算法详情指标设置 * @param options * @returns */ async saveAlgoDetail(options: AlgoDetailReq): Promise { const result = await this.factory.amis.post(`/boss/algoBoard/index`, options); return result; } /** * 获取算法详情列表 * @param eventType * @returns */ async loadAlgoDetailList(eventType: string): Promise { const result = await this.factory.amis.get(`/boss/algoBoard/index/list/${eventType}`); return result; } /** * 删除算法详情数据 * @param id * @returns */ async deleAlgoDetail(id: string): Promise { const result = await this.factory.amis.delete(`/boss/algoBoard/index/${id}`); return result; } /** * 获取统计数据 * @returns */ async loadalgoBoardStatis(): Promise { const result = await this.factory.amis.get(`/boss/algoBoard/statistics`); return result; } /** * 获取算法统计趋势 * @param type * @returns */ async loadAlgoStatisticsTrend(type: number): Promise { const result = await this.factory.amis.get(`/boss/algoBoard/statisticsTrend/${type}`); return result; } /** * 获取单个算法统计趋势 * @param type * @param eventType * @returns */ async loadOneAlgoStatisticsTrend(type: number, eventType: string): Promise { const result = await this.factory.amis.get( `/boss/algoBoard/statisticsTrend/${type}/${eventType}` ); return result; } /** * 获取算法准确率排名 * @param type 1 用户准确率, 2 技术准确率 * @returns */ async loadAccuracyRateStatistics(type: number): Promise { const result = await this.factory.amis.get( `/boss/algoBoard/accuracyRateStatistics/${type}` ); return result; } /** * 获取数据集列表 * @returns */ async loadListTest(): Promise { const result = await this.factory.amis.get(`/ai/object/listTest`); return result; } }