import { getReq, postReq } from '@/utils/requestUtil';
import langUtils from '@/utils/langUtils';

export function getXunJianDownloadUrlApi(idList) {
    return getReq('/ranger/inspection/api/v1/jobs/export', { jobIdList: idList.join(',') });
}

export function getAreaListDataApi() {
    return getReq(`/ranger/inspection/api/v1/region/list`);
}

export function getBusinessListApi() {
    return getReq(
        `/api/v1/parameters/business/list?paramModule=rpis_route_schedule&paramCode=inspection_state&paramLocale=${langUtils.get()}`,
    );
}

export function getBanZuListApi() {
    return getReq(
        `/api/v1/parameters/business/list?paramModule=rpis_route_schedule&paramCode=shift_type&paramLocale=${langUtils.get()}`,
    );
}

export function getTaskTypeApi() {
    return getReq(
        `/api/v1/parameters/business/list?paramModule=rpis_route_schedule&paramCode=job_type&paramLocale=${langUtils.get()}`,
    );
}

export function addXunJianTaskApi(data) {
    return postReq('/ranger/inspection/api/v1/jobs/temporary', data);
}
