import type { PageResponse } from '../../http'

import { del, get, post, put } from '../../http'

/**
 * @description: 获取阶段的列表
 * @param {*} params
 * @return {*}
 */
export async function getStageList(params: Record<string, any>) {
  return await get<any>('/stage/list', params)
}

export async function getStageListApi(
  params?: Record<string, any>,
): Promise<PageResponse<any>> {
  return await get(
    '/stage/list',
    params || { current: 1, size: 1000, status: 0 },
  )
}

/**
 * @description: 新增阶段
 * @param {*} params
 * @return {*}
 */
export async function addStage(data: Record<string, any>) {
  return await post<any>('/stage', data)
}
/**
 * @description: 更新阶段详情
 * @param {*} params
 * @return {*}
 */
export async function updateStage(data: Record<string, any>) {
  return await put('/stage', data)
}
/**
 * @description: 删除阶段
 * @param {*} params
 * @return {*}
 */
export async function deleteStage(id: string) {
  return await del(`/stage/${id}`)
}
