import request from "@/utils/request";

/**
 * 获取短信网关配置
 */
export function getSmsInfo() {
  return request({
    url: "/platform/sms/info",
    method: "get",
  });
}

/**
 * 编辑短信网关配置
 */
export function editSmsInfo(data: any) {
  return request({
    url: "/platform/sms/editinfo",
    method: "post",
    data,
  });
}

/**
 * 发送测试短信（入队任务，等待网关发送）
 */
export function sendTestSms(data: any) {
  return request({
    url: "/platform/sms/sendtest",
    method: "post",
    data,
  });
}

/**
 * 获取短信任务列表（租户隔离）
 */
export function getSmsTaskList(params: { status?: string | number; phone?: string } = {}) {
  return request({
    url: "/platform/sms/taskList",
    method: "get",
    params,
  });
}

/**
 * 编辑短信任务
 */
export function editSmsTask(id: number | string, data: any) {
  return request({
    url: `/platform/sms/taskEdit/${id}`,
    method: "post",
    data,
  });
}

