import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SmsmanualVO, SmsmanualForm, SmsmanualQuery } from '@/api/msg/smsmanual/types';

/**
 * 查询手工短信列表
 * @param query
 * @returns {*}
 */

export const listSmsmanual = (query?: SmsmanualQuery): AxiosPromise<SmsmanualVO[]> => {
  return request({
    url: '/msg/smsmanual/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询手工短信详细
 * @param sendId
 */
export const getSmsmanual = (sendId: string | number): AxiosPromise<SmsmanualVO> => {
  return request({
    url: '/msg/smsmanual/' + sendId,
    method: 'get'
  });
};

/**
 * 新增手工短信
 * @param data
 */
export const addSmsmanual = (data: SmsmanualForm) => {
  return request({
    url: '/msg/smsmanual',
    method: 'post',
    data: data
  });
};

/**
 * 修改手工短信
 * @param data
 */
export const updateSmsmanual = (data: SmsmanualForm) => {
  return request({
    url: '/msg/smsmanual',
    method: 'put',
    data: data
  });
};

/**
 * 删除手工短信
 * @param sendId
 */
export const delSmsmanual = (sendId: string | number | Array<string | number>) => {
  return request({
    url: '/msg/smsmanual/' + sendId,
    method: 'delete'
  });
};
