import request from '@/utils/request';
import { CustomerSettingVO, CustomerSettingForm } from './types';
import { AxiosPromise } from 'axios';

/**
 * 获取客服配置详情
 * @param id 配置ID
 */
export function getCustomerSetting(id: number | string): AxiosPromise<CustomerSettingVO> {
  return request({
    url: `/system/customerSetting/${id}`,
    method: 'get'
  });
}

/**
 * 修改客服配置
 * @param data 配置数据
 */
export function updateCustomerSetting(data: CustomerSettingForm): AxiosPromise<void> {
  return request({
    url: '/system/customerSetting/edit',
    method: 'put',
    data: data
  });
}
