import request from "@/utils/request";

/**
 * 获取需求列表
 * @returns {Promise}
 */
export function getDemandList() {
  return request({
    url: "/platform/demandList",
    method: "get",
  });
}

/**
 * 新增需求
 * @param {Object} data 需求数据
 * @returns {Promise}
 */
export function addDemand(data) {
  return request({
    url: "/platform/addDemand",
    method: "post",
    data,
  });
}

/**
 * 编辑需求
 * @param {number} id 需求ID
 * @param {Object} data 需求数据
 * @returns {Promise}
 */
export function editDemand(id, data) {
  return request({
    url: `/platform/editDemand/${id}`,
    method: "post",
    data,
  });
}

/**
 * 删除需求
 * @param {number} id 需求ID
 * @returns {Promise}
 */
export function deleteDemand(id) {
  return request({
    url: `/platform/deleteDemand/${id}`,
    method: "post",
  });
}
