数据统计
This commit is contained in:
@@ -74,4 +74,22 @@ export const learningRecordApi = {
|
||||
const response = await api.post<LearningRecord>('/study/records/course/records', filter);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取学习记录统计图表数据
|
||||
* @returns Promise<ResultDomain<any>> 图表数据(本周课程和文章的总学习时长)
|
||||
*/
|
||||
async getStudyRecordsCharts(): Promise<ResultDomain<any>> {
|
||||
const response = await api.get<any>('/study/records/statistics/charts');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取学习记录排行榜数据
|
||||
* @returns Promise<ResultDomain<any>> 排行榜数据(学习时长排行榜、课程排行榜、文章排行榜、任务完成排行榜)
|
||||
*/
|
||||
async getStudyRecordsRankings(): Promise<ResultDomain<any>> {
|
||||
const response = await api.get<any>('/study/records/statistics/rankings');
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -152,4 +152,24 @@ export const learningTaskApi = {
|
||||
const response = await api.post<TaskVO>(`${this.learningTaskPrefix}/user/progress/${userID}`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取任务统计图表数据
|
||||
* @param taskID 任务ID
|
||||
* @returns Promise<ResultDomain<any>> 图表数据(学习时长分布、学习进度分布)
|
||||
*/
|
||||
async getTaskStatisticsCharts(taskID: string): Promise<ResultDomain<any>> {
|
||||
const response = await api.get<any>(`${this.learningTaskPrefix}/${taskID}/statistics/charts`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取任务排行榜数据
|
||||
* @param taskID 任务ID
|
||||
* @returns Promise<ResultDomain<any>> 排行榜数据(完成时间排行榜、学习时长排行榜)
|
||||
*/
|
||||
async getTaskStatisticsRankings(taskID: string): Promise<ResultDomain<any>> {
|
||||
const response = await api.get<any>(`${this.learningTaskPrefix}/${taskID}/statistics/rankings`);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user