/*
 * @Author: zc
 * @description 案例库 - 案例管理
 */
import request from '@/utils/request';
/**
 * @description 获取案例库列表基础信息
 * @param {object} params
 */
export const getCaseBaseData = (params?: object) => {
	return request({
		url: '/api/v1/Case/list/status-data',
		method: 'get',
		params,
	});
};
/**
 * @description 获取案例库列表
 * @param {object} params
 */
export const getCaseList = (params?: object) => {
	return request({
		url: '/api/v1/Case/list',
		method: 'get',
		params,
	});
};
/**
 * @description 获取案例库列表导出
 * @param {object} data
 */
export const getCaseExport = (data: object) => {
	return request(
		{
			url: '/api/v1/Case/export',
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
/**
 * @description 新增案例库草稿
 * @param {object} data
 */
export const addCaseDraft = (data: object) => {
	return request({
		url: '/api/v1/Case/list/draft',
		method: 'post',
		data,
	});
};
/**
 * @description 新增案例库草稿直接到审核
 * @param {object} data
 */
export const addCaseDraftAudit = (data: object) => {
	return request({
		url: '/api/v1/Case/list/add',
		method: 'post',
		data,
	});
};
/**
 * @description 案例库详情
 * @param {object} params
 */
export const caseDetail = (params: object) => {
	return request({
		url: '/api/v1/Case/list/info',
		method: 'get',
		params,
	});
};
/**
 * @description 案例库编辑草稿
 * @param {object} data
 */
export const editCaseDraft = (data: object) => {
	return request({
		url: '/api/v1/Case/list/draftupdate',
		method: 'put',
		data,
	});
};
/**
 * @description 案例库编辑草稿到审核
 * @param {object} data
 */
export const editCaseAudit = (data: object) => {
	return request({
		url: '/api/v1/Case/list/update',
		method: 'put',
		data,
	});
};
/**
 * @description 案例库评分
 * @param {object} data
 */
export const caseScore = (data: object) => {
	return request({
		url: '/api/v1/Case/list/score',
		method: 'put',
		data,
	});
};
/**
 * @description 案例库审核
 * @param {object} data
 */
export const caseAudit = (data: object) => {
	return request({
		url: '/api/v1/Case/list/examin',
		method: 'put',
		data,
	});
};
/**
 * @description 案例查重
 * @param {object} data
 */
export const caseRepeat = (data: object) => {
	return request({
		url: '/api/v1/Case/list/exist',
		method: 'post',
		data,
	});
};
/**
 * @description 案例库详情导出
 * @param {object} data
 */
export const caseDetailExport = (data: object) => {
	return request(
		{
			url: '/api/v1/Case/list/info/export',
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
/**
 * @description 案例库删除提交到审核
 * @param {object} data
 */
export const caseDelAudit = (data: object) => {
	return request({
		url: '/api/v1/Case/list/remove',
		method: 'delete',
		data,
	});
};
/**
 * @description 案例库上架
 * @param {string} id
 */
export const caseOnShelf = (id: string) => {
	return request({
		url: `/api/v1/Case/list/onshelf/${id}`,
		method: 'get',
	});
};
/**
 * @description 案例库下架
 * @param {string} id
 */
export const caseOffShelf = (id: string) => {
	return request({
		url: `/api/v1/Case/list/offshelf/${id}`,
		method: 'get',
	});
};
/**
 * @description 查询案例库申请理由
 * @param {string} id
 */
export const caseReason = (id: string) => {
	return request({
		url: `/api/v1/Case/list/reason/${id}`,
		method: 'get',
	});
};
/**
 * @description 设置和取消热门
 * @param {object} data
 */
export const caseHot = (data: object) => {
	return request({
		url: '/api/v1/Case/list/popular',
		method: 'post',
		data,
	});
};