import request from "@/api/Request";
// 创建应用
export const createApplication = (data) => {
    return request({
        url: '/application/createApplication',
        method: 'post',
        data: data
    })
}
//获取应用列表

export const getAllApplication = (params) => {
    return request({
        url: '/application/getAllApplication',
        method: 'get',
        params: params
    })
}
// 获取图层树
export const getApplicationInfo = (id) => {
    return request({
        url: '/application/getApplicationInfo/' + id,
        method: 'get',
    })
}
// 获取图层列表
export const getServerByType = (params) => {
    return request({
        url: '/application/getServerByType',
        method: 'get',
        params: params
    })
}
// 获取图层样式
export const getInfo = (params) => {
    return request({
        url: '/style/getInfo',
        method: 'get',
        params: params
    })
}
// 获取图层地址
export const getUrlByServerName = (params) => {
    return request({
        url: '/style/getUrlByServerName',
        method: 'get',
        params: params
    })
}
// 获取图标
export const getAllStyleImage = () => {
    return request({
        url: '/style/getAllStyleImage',
        method: 'get',
    })
}
//删除图标
export const deleteIds = (id) => {
    return request({
        url: '/style/deleteIds/' + id,
        method: 'delete',
    })
}
//创建项目
export const createProject = (data) => {
    return request({
        url: '/application/createProject',
        method: 'post',
        data:data
    })
}
//创建项目
export const addServer = (data) => {
    return request({
        url: '/application/addServer',
        method: 'put',
        data:data
    })
}
//获取项目名称
export const getProjectName = (id) => {
    return request({
        url: '/application/getProjectName/'+ id,
        method: 'get',
    })
}
//删除图层或项目组
export const applicationdelete = (id) => {
    return request({
        url: '/application/deleteIds/'+ id,
        method: 'delete',
    })
}
//更新样式
export const update = (data) => {
    return request({
        url: '/style/update',
        method: 'put',
        data:data
    })
}