import config from "@/config"
import http from "@/utils/request"

export default {
	folder: {
		url: `${config.API_URL}/zcxt`,
		name: "文件上传",
		up: async function (data, config = {}) {
			return await http.post(`${this.url}/file/upload`, data, config);
		},

		rm: async function (entityID) {
			return await http.post(`${this.url}/folder/rm`, { querys: [], expands: { entityID } });
		},

		get: async function (entityID) {
			return await http.get(`${this.url}/folder/${entityID}`, {}, { responseType: "blob" });
		}
	}
}
