import axios from '../axios';

/*
* 查询
*/
export function getList(num: number, page: number, obj:object){
    const rData = {
        num:num,
        page:page,
        industryId:obj['industryId'],
        serviceTypeId:obj['serviceTypeId'],
        questionContent:obj['questionContent']
    };
    return axios({
        url: "/ex/question/list",
        method: 'post',
        data: rData
    })
}

/*
* 删除(明细)
*/
export function deleteQuestion(id: number) {
    return axios({
        url: '/ex/question/delete?id=' + id,
        method: 'get'
    });
}

/*
* 删除
*/
export function deleteQuestionList(ids: any) {
    return axios({
        url: '/ex/question/deleteList',
        method: 'post',
        data: ids
    });
}

/*
* 新增题目
*/
export function add(questionData: object) {
    return axios({
        url: "/ex/question/add",
        method: 'post',
        data: questionData
    });
}

/*
* 修改题目
*/
export function update(questionData: object) {
    return axios({
        url: "/ex/question/update",
        method: 'post',
        data: questionData
    });
}

/*
* 行业
*/
export function findIndustry() {
    return axios({
        url: '/ex/question/findIndustry',
        method: 'get'
    })
}

/*
* 题目详情
*/
export function getDetail(id: string|null) {
    return axios({
        url: '/ex/question/getDetail?id=' + id,
        method: 'get'
    });
}
