import { http } from "@/utils/http";

/** 获取消息模板列表 */
export const getTemplateList = (params?: object) => {
  return http.request<any>("get", "/messageTemplate/list", { params });
};

/** 新增消息模板 */
export const createTemplate = (data: object) => {
  return http.request<any>("post", "/messageTemplate/create", { data });
};

/** 修改消息模板 */
export const updateTemplate = (data: object) => {
  return http.request<any>("post", "/messageTemplate/update", { data });
};

/** 删除消息模板 */
export const deleteTemplate = (id: number) => {
  return http.request<any>("post", `/messageTemplate/delete/${id}`);
};

/** 使用模板发送消息 */
export const sendByTemplate = (data: object) => {
  return http.request<any>("post", "/message/sendByTemplate", { data });
};
