import { TUsingunitGroupModel, TUsingunitGroupQueryParam } from '@/types'
import request from '@/until/request'

/**
 * 获取使用单位分组列表
 * @param data TUsingunitGroupQueryParam
 */
const QueryTUsingunitGroupList = (data: TUsingunitGroupQueryParam) =>
    request({
        url: '/TUsingunitGroupAction/list',
        method: 'post',
        data: data
    })

/**
* 新增使用单位分组
* @param data TUsingunitGroupModel
*/
const AddTUsingunitGroup = (data: TUsingunitGroupModel) =>
    request({
        url: '/TUsingunitGroupAction/saveTUsingunitGroup',
        method: 'post',
        data: data
    })

/**
* 编辑使用单位分组
* @param data TUsingunitGroupModel
*/
const EditTUsingunitGroup = (data: TUsingunitGroupModel) =>
    request({
        url: '/TUsingunitGroupAction/updateTUsingunitGroup',
        method: 'post',
        data: data
    })

/**
* 删除使用单位分组
* @param  id number
*/
const DeleteTUsingunitGroup = (id: number) =>
    request({
        url: '/TUsingunitGroupAction/deleteTUsingunitGroup/' + id,
        method: 'get',
    })

export default {
    QueryTUsingunitGroupList,
    AddTUsingunitGroup,
    EditTUsingunitGroup,
    DeleteTUsingunitGroup,
}