import {
    request
} from '@/untils/AxiosUtils.js';
import {
    getStore
} from '@/untils/store.js'

function getHeader() {
    const platformId = getStore({
        name: 'platformId'
    })
    if (platformId) {
        return {
            'Platform-Id': platformId
        }
    } else {
        return {}
    }
}
/*首页 最新任务(10条)*/
export const getPushListByUserId = (params) => {
    return request({
        url: '/api/jobslink-api/user/userrecruit/getPushListByUserId',
        headers: getHeader(),
        method: 'get',
        params

    })
}

/*岗位详情*/
// workDetail
export const userrecruitDetail = (workId) => {
    return request({
        url: '/api/jobslink-api/user/userrecruit/getWorksInfoByWorkId',
        method: 'get',
        params: {
            workId
        }
    })
}

export const submitInfo = (data) => {
    return request({
        url: '/api/jobslink-api/user/userrecruit/saveApp',
        method: 'post',
        data: data
    })
}

export const getuserrecruitListApp = (params) => {
    return request({
        url: '/api/jobslink-api/user/userrecruit/listApp',
        method: 'get',
        params
    })
}
export const getuserrecruitDetailApp = (params) => {
    return request({
        url: '/api/jobslink-api/user/userrecruit/detailApp',
        method: 'get',
        params
    })
}

export const seeIsHaveCodep = (params) => {
    return request({
        url: '/api/jobslink-api/tenant/company/app/isHaveCode',
        method: 'get',
        params
    })
}
export const getWorktypesBaseList = (params) => {
    return request({
        url: '/api/jobslink-api/tenant/worktypes/base/list',
        method: 'get',
        params
    })
}

export const getUserCompanyInfo = (params) => {
    return request({
        url: '/api/jobslink-api/user/user/userCompanyInfo',
        method: 'get',
        params
    })
}
export const findTradeList = () => {
    return request({
        url: '/api/jobslink-api/tenant/trade/base/find',
        method: 'get',
        // params
    })
}

export const addInviteCompanyAuth = (params) => {
    return request({
        url: '/api/jobslink-api/tenant/company/app/inviteCompany/auth',
        method: 'post',
        data: params
    })
}

export const getInviteCompanyAuthInfo = (params) => {
    return request({
        url: '/api/jobslink-api/tenant/company/app/inviteCompany/authInfo',
        method: 'get',
        data: params
    })
}

export const getDictionary = (params) => {
    return request({
        url: '/api/jobslink-api/system/dict-biz/dictionary',
        method: 'get',
        params
    })
}
export const getDictionary2 = () => request({
    url: '/api/jobslink-api/system/dict-biz/dictionary?code=company_nature',
    method: 'get',
})
export const getInviteUserList = (params) => request({
    url: '/api/jobslink-api/user/userrecruit/getInviteUserList',
    method: 'get',
    params
})
export const userrecruitUserInvite = (params) => request({
    url: '/api/jobslink-api/user/userrecruit/userInvite',
    method: 'get',
    params
})
export const cancelUserInvite = (params) => request({
    url: '/api/jobslink-api/user/userrecruit/cancelUserInvite',
    method: 'get',
    params
})
export const getDeptAllTree = (params) => request({
    url: '/api/jobslink-api/system/dept/town-tree',
    method: 'get',
    params
})