import { StationGroupQueryParam, StationGroupModel } from '@/types'
import request from '@/until/request'

/**
 * 获取遥测站分组列表
 * @param data StationGroupQueryParam
 */
const QueryStationGroupList = (data: StationGroupQueryParam) =>
    request({
        url: '/StationGroupAction/fingStationGroup/' + data.customerId,
        method: 'get'
    })

/**
* 查询遥测站分组和遥测站树
* @param data StationGroupQueryParam
*/
const QueryStationGroupAndStationList = (data: StationGroupQueryParam) =>
    request({
        url: '/StationGroupAction/fingStationGroupAndStation/' + data.customerId,
        method: 'get'
    })
/**
* 新增遥测站分组
* @param data StationGroupModel
*/
const AddStationGroup = (data: StationGroupModel) =>
    request({
        url: '/StationGroupAction/saveStationGroup',
        method: 'post',
        data: data
    })

/**
* 编辑遥测站分组
* @param data StationGroupModel
*/
const EditStationGroup = (data: StationGroupModel) =>
    request({
        url: '/StationGroupAction/updateStationGroup',
        method: 'post',
        data: data
    })

/**
* 删除遥测站分组
* @param  id number
*/
const DeleteStationGroup = (id: number) =>
    request({
        url: '/StationGroupAction/deleteStationGroup/' + id,
        method: 'get',
    })

export default {
    QueryStationGroupList,
    QueryStationGroupAndStationList,
    AddStationGroup,
    EditStationGroup,
    DeleteStationGroup
}