import { defHttp } from '/@/utils/http/axios';
import {
  MailLogModelResult,
  MessageRecordsParams,
  SmsLogModelResult,
} from '/@/api/message/model/recordsModel';

enum MessageRecordsApi {
  SMS_RECORDS = '/sms_log',
  EMAIL_RECORDS = '/mail_log',
}

/**
 * 获取短信发送记录【分页】
 * @param params 查询参数
 */
export const smsLogPage = (params: MessageRecordsParams) => {
  // return defHttp.get<SmsLogModelResult>({
  //   url: MessageRecordsApi.SMS_RECORDS,
  //   params,
  // });
};

/**
 * 获取邮件发送记录【分页】
 * @param params 查询参数
 */
export const mailLogPage = (params: MessageRecordsParams) => {
  return defHttp.get<MailLogModelResult>({
    url: MessageRecordsApi.EMAIL_RECORDS,
    params,
  });
};

/**
 * 删除邮件记录
 * @param ids 邮件记录ID
 */
export const deleteMailLog = (ids: string[]) =>
  defHttp.delete({
    url: MessageRecordsApi.EMAIL_RECORDS,
    data: {
      ids: ids,
    },
  });
/**
 * 删除短信记录
 * @param ids 短信记录ID
 */
export const deleteSmsLog = (ids: string[]) =>
  defHttp.delete({
    url: MessageRecordsApi.SMS_RECORDS,
    data: {
      ids: ids,
    },
  });
