/*
 * @Author: zc
 * @description 知识库 - 类型管理
 */
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} params
 * @return {*}
 */
export const knowledgeDepartmentList = (params?: object) => {
	return request({
		url: '/api/v1/KnowledgeCommon/treelist/org',
		method: 'get',
		params,
	});
};
/**
 * @description 知识库热点
 * @param {object} params
 * @return {*}
 */
export const knowledgeHotSpotList = (params?: object) => {
	return request({
		url: '/api/v1/KnowledgeCommon/treelist/hotspot',
		method: 'get',
		params,
	});
};
/**
 * @description 知识库热点搜索
 * @param {object} params 热点名称
 */
export const knowledgeHotSpotSearch = (params: object) => {
	return request({
		url: `/api/v1/KnowledgeCommon/treelist/children-hasname`,
		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',
	});
};