竞赛任务api提交
This commit is contained in:
parent
0be7c03f81
commit
757f661a22
@ -0,0 +1,72 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 查看所有任务数据 */
|
||||
export function getTaskTreeDatas() {
|
||||
return request({
|
||||
url: '/api/exercise/race/task/tree',
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建任务
|
||||
* @param {Object} data
|
||||
* @param {String} data.name 任务名称
|
||||
* @param {String} data.desc 基础描述
|
||||
* @param {String} data.content 考核内容
|
||||
* @param {String} data.standards 评价标准
|
||||
* @param {Number} data.parentId 如果是子任务,需要父任务的id
|
||||
*/
|
||||
export function createTask(data) {
|
||||
return request({
|
||||
url: '/api/exercise/race/task',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改指定任务
|
||||
* @param {Object} data 同创建任务
|
||||
* @param {Number} data.id 任务id
|
||||
*/
|
||||
export function editTask(data) {
|
||||
return request({
|
||||
url: `/api/exercise/race/task/${data.id}`,
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除指定任务
|
||||
* @param {Number} id 任务id
|
||||
*/
|
||||
export function deleteTask(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/task/${id}`,
|
||||
method: 'DELETE'
|
||||
});
|
||||
}
|
||||
|
||||
/** 查看指定子任务
|
||||
* @param {Number} id 任务id
|
||||
*/
|
||||
export function getchildrenTaskDatas(id) {
|
||||
return request({
|
||||
url: `/api/exercise/race/task/${id}/children`,
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
||||
/** 任务绑定
|
||||
* @param {Object} data
|
||||
* @param {Number} data.taskId 任务名称
|
||||
* @param {Number} data.bindId 绑定id,根据bindtype来区分对应的id
|
||||
* @param {String} data.bindType rule =评分规则;scene=场景
|
||||
*/
|
||||
export function bindTask(data) {
|
||||
return request({
|
||||
url: '/api/exercise/race/task/bind',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user