organization.js 1.78 KB
Newer Older
陈浩玮's avatar
陈浩玮 committed
1 2
import { delReq, getReq, postReq, putReq } from '@/utils';

陈浩玮's avatar
陈浩玮 committed
3 4 5 6
function getJobsApi(data) {
    return getReq('/api/v1/jobs', data);
}

陈浩玮's avatar
陈浩玮 committed
7 8 9 10 11 12 13 14
function addJobsApi(data) {
    return postReq('/api/v1/jobs', data);
}

function updateJobsApi(data) {
    return putReq('/api/v1/jobs', data);
}

陈浩玮's avatar
陈浩玮 committed
15
function getOrganizationListApi(data) {
陈浩玮's avatar
陈浩玮 committed
16 17 18
    return getReq('/api/v1/organizations', data);
}

陈浩玮's avatar
陈浩玮 committed
19 20 21 22 23 24 25 26 27 28 29 30
function getOrganizationDetailsApi(id) {
    return getReq(`/api/v1/organizations/${id}`);
}

function addOrgApi(data) {
    return postReq('/api/v1/organizations', data);
}

function updateOrgApi(data) {
    return putReq('/api/v1/organizations', data);
}

陈浩玮's avatar
陈浩玮 committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
function addBusinessApi(data) {
    return postReq('/api/v1/parameters/business', data);
}

function updateBusinessApi(data) {
    return putReq('/api/v1/parameters/business', data);
}

function addOperationApi(data) {
    return postReq('/api/v1/parameters/operation', data);
}

function updateOperationApi(data) {
    return putReq('/api/v1/parameters/operation', data);
}
陈浩玮's avatar
yonghu  
陈浩玮 committed
46 47 48 49 50 51 52 53 54 55 56 57

function getRolesApi(data) {
    return getReq('/api/v1/roles', data);
}
function getUsersInfoApi({ userId }) {
    return getReq(`/api/v1/users/${userId}`);
}

export const addUserApi = data => postReq('/api/v1/users', data);

export const updateUserApi = data => putReq('/api/v1/users', data);

陈浩玮's avatar
陈浩玮 committed
58
export default {
陈浩玮's avatar
陈浩玮 committed
59 60
    addJobs: addJobsApi,
    updateJobs: updateJobsApi,
陈浩玮's avatar
陈浩玮 committed
61 62 63 64 65
    getOrganizationList: getOrganizationListApi,
    getJobs: getJobsApi,
    getOrganizationDetails: getOrganizationDetailsApi,
    addOrg: addOrgApi,
    updateOrg: updateOrgApi,
陈浩玮's avatar
陈浩玮 committed
66 67 68 69
    addBusiness: addBusinessApi,
    updateBusiness: updateBusinessApi,
    addOperation: addOperationApi,
    updateOperation: updateOperationApi,
陈浩玮's avatar
yonghu  
陈浩玮 committed
70 71 72 73
    getRoles: getRolesApi,
    getUsersInfo: getUsersInfoApi,
    addUser: addUserApi,
    updateUser: updateUserApi,
陈浩玮's avatar
陈浩玮 committed
74
};