import request from '@/utils/request'
import qs from 'qs'

const baseUrl = '/api/upcloud-base-common';


export const api = {

    queryList: baseUrl + '/dicttype/page',
    queryItem: baseUrl + '/dicttype',

    addItem: baseUrl + '/dicttype/add',
    uploadItem: baseUrl + '/dicttype/update',

    deleteList: baseUrl + '/dicttype/delete'

};

export function queryItem(parameter) {
    return request({
        method: 'get',
        url: api.queryItem,
        params: parameter,
    })
}


export function addItem(parameter) {
    return request({
        method: 'post',
        url: api.addItem,
        data: parameter,
    })
}

export function uploadItem(parameter) {
    return request({
        method: 'post',
        url: api.uploadItem,
        data: parameter,
    })
}

export function deleteList(parameter) {
    return request({
        method: 'post',
        url: api.deleteList,
        data: qs.stringify(parameter),
        headers: {
            'content-type': 'application/x-www-form-urlencoded'
        }
    })
}