import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询仓库列表
export function listWareHouse(query) {
	return request({
		url: '/system/repository/list',
		method: 'get',
		params: query
	})
}

// 查询仓库详细
export function getWareHouse(repositoryIds) {
  return request({
    url: '/system/repository/' + parseStrEmpty(repositoryIds),
    method: 'get'
  })
}

// 新增仓库
export function addWareHouse(data) {
  return request({
    url: '/system/repository',
    method: 'post',
    data: data
  })
}

// 修改仓库
export function updateWareHouse(data) {
  return request({
    url: '/system/repository',
    method: 'put',
    data: data
  })
}

// 删除仓库
export function delWareHouse(repositoryIds) {
  return request({
    url: '/system/repository/' + repositoryIds,
    method: 'delete'
  })
}

// 查询仓库树形列表
export function treeWareHouse(query) {
	return request({
		url: '/system/file/tree',
		method: 'get',
		params: query
	})
}
// 查询权限树形列表
export function treePermissions(query) {
	return request({
		url: '/system/permissions/tree',
		method: 'get',
		params: query
	})
}
// 查询回收站列表
export function recycleFile(query) {
	return request({
		url: '/system/file/recycle',
		method: 'get',
		params: query
	})
}
// 将文件还原
export function recycleFileBin(data) {
	return request({
		url: '/system/file/recycle',
		method: 'put',
		data: data
	})
}