import { defHttp } from '/@/utils/http/axios';
import { setParams } from '/@/utils/index';
enum Api {
  sysNotifyConfigAdd = '/sys/notify/config/add',
  sysNotifyConfigDetailConfigId = '/sys/notify/config/detail',
  sysNotifyConfigEdit = '/sys/notify/config/edit',
  sysNotifyConfigExport = '/sys/notify/config/export',
  sysNotifyConfigQueryList = '/sys/notify/config/query/list',
  sysNotifyConfigRemove = '/sys/notify/config/remove',
}

/**
 * @description: 新增通知模板,权限 - rbac:config:add
 * @method: POST
 */
export const sysNotifyConfigAdd = (params?: object) => {
  return defHttp.post({ url: Api.sysNotifyConfigAdd, params: params });
};
/**
 * @description: 获取通知模板详细信息,权限 - notify:config:query
 * @method: GET
 */
export const sysNotifyConfigDetailConfigId = (configId?: string | number, params?: object) => {
  return defHttp.get({ url: Api.sysNotifyConfigDetailConfigId + '/' + configId, params: params });
};
/**
 * @description: 通过主键id修改通知模板,权限 - notify:config:edit
 * @method: GET
 */
export const sysNotifyConfigEdit = (params?: object) => {
  return defHttp.get({ url: Api.sysNotifyConfigEdit, params: params });
};
/**
 * @description: 导出通知模板
 * @method: POST
 */
export const sysNotifyConfigExport = (params?: object) => {
  return defHttp.post({ url: Api.sysNotifyConfigExport, params: params });
};
/**
 * @description: 查询通知模板列表,权限 - rbac:config:list
 * @method: POST
 */

export const sysNotifyConfigQueryList = (params?: object) => {
  return defHttp.post({ url: Api.sysNotifyConfigQueryList, params: setParams(params) });
};
/**
 * @description: 删除通知模板,权限 - notify:config:remove
 * @method: POST
 */

export const sysNotifyConfigRemove = (params?: Array<string | number>) => {
  return defHttp.post({ url: Api.sysNotifyConfigRemove, params: params });
};
