import { DicStkroomModel, DicStkroomModelQueryParam } from '@/types'
import request from '@/until/request'

/**
 * 获取库房列表
 * @param data DicStkroomModelQueryParam
 */
const QueryDicStkroomList = (data: DicStkroomModelQueryParam) =>
    request({
        url: '/DicStkroomAction/list',
        method: 'get'
    })

/**
* 新增库房
* @param data DicStkroomModel
*/
const AddDicStkroom = (data: DicStkroomModel) =>
    request({

        url: '/DicStkroomAction/saveDicStkroom',
        method: 'post',
        data: data
    })

/**
* 编辑库房
* @param data DicStkroomModel
*/
const EditDicStkroom = (data: DicStkroomModel) =>
    request({
        url: '/DicStkroomAction/updateDicStkroom',
        method: 'post',
        data: data
    })

/**
* 删除库房
* @param  id number
*/
const DeleteDicStkroom = (id: number) =>
    request({
        url: '/DicStkroomAction/deleteDicStkroom/' + id,
        method: 'get',
    })

export default {
    QueryDicStkroomList,
    AddDicStkroom,
    EditDicStkroom,
    DeleteDicStkroom
}