import request from "@/api/Request";
// 获取字典
export const getDictone = () => {
    return request({
        url: '/geoserver/getDict/space_type',
        method: 'get',
    })
}
// 获取字典
export const getDicttwo = () => {
    return request({
        url: '/geoserver/getDict/sever_type',
        method: 'get',
    })
}
// 数据提交
export const saveData = (data) => {
    return request({
        url: '/geoserver/saveData',
        method: 'post',
        data: data
    })
}
// 取消
export const canelSave = (tableName) => {
    return request({
        url: '/geoserver/cancelSave/' + tableName,
        method: 'get'
    })
}
// 测试接口
export const publishLayer = (tableName) => {
    return request({
        url: '/geoserver/publishLayer/' + tableName,
        method: 'get'
    })
}
//获取样式字典
export const getLayerStyle = () => {
    return request({
        url: '/geoserver/getLayerStyle',
        method: 'get'
    })
}
// 样式编辑
export const saveLayerStyle = (params) => {
    return request({
        url: '/geoserver/saveLayerStyle',
        method: 'post',
        data: params
    })
}
// 服务名校验
export const checkServerName = (name) => {
    return request({
        url: '/geoserver/checkServerName/' + name,
        method: 'get'
    })
}
// 文件上传
export const uploadFile = (formData) => {
    return request({
        url: '/geoserver/uploadFile',
        method: 'post',
        headers: {
            "Content-Type": "multipart/form-data",
            Authorization: localStorage.getItem("X-Token") || "",
        },
        data: formData

    })
}

