/*
 * @Author: zc
 * @description 知识管理类型管理
 * @version:
 * @Date: 2022-08-09 16:19:55
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-11-15 10:21:44
 */
import request from '/@/utils/request';
/**
 * @description 知识管理类型树形
 * @param {object} params 如果传入参数 IsEnable 表示查询已启用
 * @return {*}
 */
export const treeList = (params?: object) => {
	return request({
		url: '/api/v1/KnowledgeCommon/treelist',
		method: 'get',
		params
	});
};
/**
 * @description 新增类型
 * @param {object} data
 * @return {*}
 */
export const addType = (data: object) => {
	return request({
		url: '/api/v1/KnowledgeCommon/add',
		method: 'post',
		data
	});
};
/**
 * @description 修改类型
 * @param {object} data
 * @return {*}
 */
export const updateType = (data: object) => {
	return request({
		url: '/api/v1/KnowledgeCommon/update',
		method: 'put',
		data
	});
};
/**
 * @description 查询类型详情
 * @param {string} id
 * @return {*}
 */
export const typeDetail = (id: string) => {
	return request({
		url: `/api/v1/KnowledgeCommon/info/${id}`,
		method: 'get',
	});
};
/**
 * @description 删除类型
 * @param {string} id
 * @return {*}
 */
export const delType = (id: string) => {
	return request({
		url: `/api/v1/KnowledgeCommon/remove?Id=${id}`,
		method: 'delete',
	});
};
/**
 * @description 类型启用禁用
 * @param {string} id
 * @return {*}
 */
export const changeAble = (id: string) => {
	return request({
		url: `/api/v1/KnowledgeCommon/changestate?Id=${id}`,
		method: 'put',
	});
};
/**
 * @description 禁用并下架
 * @param {string} id
 * @return {*}
 */
export const changeStateAndOffShelf = (id: string) => {
	return request({
		url: `/api/v1/KnowledgeCommon/changestateandoffshelf?Id=${id}`,
		method: 'put',
	});
};