import request from "@/utils/httpRequest";
import { PUBLIC_MODULES_PATH as prefix } from "../AppPath";

export default {
	collection(data) {
		return request({
			url: prefix + "/workCollectAccessory/collection",
			method: "post",
			data: data,
		});
	},

	share(data) {
		return request({
			url: prefix + "/workCollectAccessory/share",
			method: "post",
			data: data,
		});
	},

	list(param) {
		return request({
			url: prefix + "/workCollectAccessory/list",
			method: "get",
			params: param,
		});
	},

	del(data) {
		return request({
			url: prefix + "/workCollectAccessory/del",
			method: "post",
			data: data,
		});
	},

	saveForm(data) {
		return request({
			url: prefix + "/workCollectAccessory/saveForm",
			method: "post",
			data: data,
		});
	},

	downloadAndUploadToOSS(data) {
		return request({
			url: prefix + "/oss/file/downloadAndUploadToOSS",
			method: "post",
			data: data,
		});
	},
	updateById(data) {
		return request({
			url: prefix + "/workCollectAccessory/updateById",
			method: "post",
			data: data,
		});
	},

	queryById(id) {
		return request({
			url: prefix + "/workCollectAccessory/queryById",
			method: "get",
			params: {
				id: id,
			},
		});
	},

	queryDictListByName(dictName) {
		return request({
			url: prefix + "/workCollectAccessory/queryDictListByName",
			method: "get",
			params: {
				dictName: dictName,
			},
		});
	},

	// 根据分类去重查询
	getClassificationList(param) {
		return request({
			url: prefix + "/workCollectAccessory/getClassificationList",
			method: "get",
			params: param,
		});
	},
};
