import request from '@/utils/request';
import { CustomerServiceSettingVO, CustomerServiceSettingForm } from './types';
import { AxiosPromise } from 'axios';

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

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