import { defHttp } from '/@/utils/http/axios';

enum Api {
  sysSettingDetail = '/sys/config/get/current',
  sysSettingQuery = '/sys/config/edit',
  sysSettingEdit = '/sys/config/edit',
  sysSettingDefault = '/sys/config/get/default',
}

/**
 *
 * @author fan
 * @date  2023/05/04 15:42
 * @description: 获取系统默认配置信息
 * @method: POST
 */

export const sysSettingQuery = (params?: object) => {
  return defHttp.post({ url: Api.sysSettingQuery, params: params });
};
/**
 *
 * @author fan
 * @date  2023/05/04 15:42
 * @description: 查看系统当前配置信息
 * @method: GET
 */
export const sysSettingDetail = () => {
  return defHttp.get({ url: Api.sysSettingDetail });
};

/**
 *
 * @author fan
 * @date  2023/05/04 15:42
 * @description: 修改系统配置信息
 * @method: POST
 * @return:
 *       0 编辑失败
 *       1 编辑成功
 */
export const sysSettingEdit = (params?: object) => {
  return defHttp.post({ url: Api.sysSettingEdit, params: params });
};
//重置系统默认配置
export const sysSettingDefault = (params?: object) => {
  return defHttp.post({ url: Api.sysSettingDefault, params: params });
};
