import request from '@/utils/request'

/**
 * 获取深度画布
 * @param id depth id
 * @returns 深度画布数据
 */
export const getDepthCanvas = (id: string) => {
	return request({
		url: `/api/deep-canvas/${id}`,
		method: 'get',
		loading: true,
	})
}

/**
 * 保存深度画布
 * @param data 保存depth的画布数据
 * @returns 保存结果
 */
export const saveDepthCanvas = (data: object) => {
	return request({
		url: `/api/deep-canvas/update`,
		method: 'put',
		data,
		loading: true,
	})
}

/**
 * 删除深度画布
 * @param id depth id
 * @returns 删除结果
 */
export const deleteDepthCanvas = (id: string) => {
	return request({
		url: `/api/deep-canvas/${id}`,
		method: 'delete',
		loading: true,
	})
}

/**
 * 获取分隔后图片
 * @param data 分隔参数数据
 * @returns 分隔后图片数据
 */
export const getSegAnythingImage = (data: object) => {
	return request({
		url: `/api/python/segAnything`,
		method: 'post',
		data,
	})
}
