// 服务设施模块
import request from '@/utils/request'

// 节点管理
// 获取节点
export const getNodeList = (params) => request.basic.get('/api/v1/service-nodes', params)

// 创建节点
export const createNode = (params) => request.basic.post('/api/v1/service-nodes', params)

// 删除节点
export const delNode = (id) => request.basic.delete(`/api/v1/service-nodes/${id}`)

// 服务组织管理
// 新建服务组织
export const createServiceOrg = (params) => request.basic.post('/api/v1/organizations', params)

// 获取服务组织列表
export const getServiceOrgList = (params) => request.basic.get('/api/v1/organizations', params)

// 获取服务组织详情
export const getServiceOrgDetail = (id) => request.basic.get(`/api/v1/organizations/${id}`)

// 修改服务组织
export const updateServiceOrg = (id, params) => request.basic.put(`/api/v1/organizations/${id}`, params)

// 停用启用接口
export const enableOrDisable = (id, params) => request.basic.put(`/api/v1/organizations/status/${id}`, params)

// 服务站点
// 新增服务站点
export const createServiceSite = (params) => request.basic.post('/api/v1/stations', params)

// 获取所有机构下拉
export const getOrgSelect = () => request.basic.get('/api/v1/organizations/all')


// 获取服务站点列表
export const getServiceSiteList = (params) => request.basic.get('/api/v1/stations', params)

// 获取服务站点详情        
export const getServiceSiteDetail = (id) => request.basic.get(`/api/v1/stations/${id}`)

// 修改服务站点                                                                                
export const updateServiceSite = (id, params) => request.basic.put(`/api/v1/stations/${id}`, params)       

// 删除服务站点
export const delServiceSite = (id) => request.basic.delete(`/api/v1/stations/${id}`)

//停用启用服务站点的参数是id和params，params里面有status，1为启用，0为停用
export const enableOrDisableServiceSite = (id, params) => request.basic.put(`/api/v1/stations/status/${id}`, params)
