rt-sim-training-client/src/api/quest.js

61 lines
1.3 KiB
JavaScript
Raw Normal View History

2019-07-26 13:32:43 +08:00
import request from '@/utils/request';
2019-08-15 14:06:53 +08:00
/** 查找个人录制的仿真任务*/
export function getQuestPageList(mapId) {
2019-08-08 14:32:32 +08:00
return request({
2019-09-30 18:13:24 +08:00
// url: `/api/script/${mapId}/list`,
url: `/api/script/draft/list/${mapId}`,
2019-08-15 14:06:53 +08:00
method: 'get'
2019-08-08 14:32:32 +08:00
});
2019-07-26 13:32:43 +08:00
}
/** 创建任务 */
export function createQuest(data) {
2019-08-08 14:32:32 +08:00
return request({
2019-09-30 17:31:40 +08:00
// url: `/api/script`,
url: `/api/script/draft/create`,
2019-08-08 14:32:32 +08:00
method: 'post',
data
});
2019-07-26 13:32:43 +08:00
}
/** 根据任务id删除任务 */
export function deleteQuest(id) {
2019-08-08 14:32:32 +08:00
return request({
2019-09-30 17:31:40 +08:00
// url: `/api/script/${id}`,
url: `/api/script/draft/${id}/delete`,
2019-08-08 14:32:32 +08:00
method: 'delete'
});
2019-07-26 13:32:43 +08:00
}
/** 根据id查询任务基础信息 */
export function getQuestById(id) {
2019-08-08 14:32:32 +08:00
return request({
2019-09-30 18:13:24 +08:00
// url: `/api/script/${id}/basic`,
url: `/api/script/draft/${id}/basic`,
2019-08-08 14:32:32 +08:00
method: 'get'
});
}
/** 根据id查询任务基础信息 */
export function getQuestByIdList(id) {
2019-08-08 14:32:32 +08:00
return request({
url: `/api/quest/${id}/detail`,
method: 'get'
});
2019-07-26 13:32:43 +08:00
}
/** 更新任务基本信息 */
export function updateQuest(id, data) {
2019-08-08 14:32:32 +08:00
return request({
2019-09-30 17:31:40 +08:00
// url: `/api/script/${id}`,
url: `/api/script/draft/${id}/update`,
2019-08-08 14:32:32 +08:00
method: 'put',
data
});
2019-08-08 10:31:46 +08:00
}
2019-08-12 19:30:50 +08:00
/** 分页查找上线的仿真任务*/
export function getQuestPageListOnline(params) {
return request({
url: `/api/quest/paging/online`,
method: 'get',
params: params
});
}