import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { WebsiteSettingVO, WebsiteSettingEditForm } from './types';

/**
 * 获取网站设置
 */
export const getWebsiteSetting = (id: number | string = 1): AxiosPromise<WebsiteSettingVO> => {
  return request({
    url: '/system/websiteSetting/' + id,
    method: 'get'
  });
};

/**
 * 修改网站设置
 */
export const editWebsiteSetting = (data: WebsiteSettingEditForm) => {
  return request({
    url: '/system/websiteSetting/edit',
    method: 'put',
    data: data
  });
};

export default {
    getWebsiteSetting,
    editWebsiteSetting
};
