import request from '@/config/axios'

// 客服信息 VO
export interface CustomServiceInfoVO {
  id: number // 主键id
  name: string // 姓名
  avater: string // 头像
  description: string // 简介
  concat: string // 微信
  phone: string // 手机号
}

// 客服信息 API
export const CustomServiceInfoApi = {
  // 查询客服信息分页
  getCustomServiceInfoPage: async (params: any) => {
    return await request.get({ url: `/server/custom-service-info/page`, params })
  },

  // 查询客服信息详情
  getCustomServiceInfo: async (id: number) => {
    return await request.get({ url: `/server/custom-service-info/get?id=` + id })
  },

  // 新增客服信息
  createCustomServiceInfo: async (data: CustomServiceInfoVO) => {
    return await request.post({ url: `/server/custom-service-info/create`, data })
  },

  // 修改客服信息
  updateCustomServiceInfo: async (data: CustomServiceInfoVO) => {
    return await request.put({ url: `/server/custom-service-info/update`, data })
  },

  // 删除客服信息
  deleteCustomServiceInfo: async (id: number) => {
    return await request.delete({ url: `/server/custom-service-info/delete?id=` + id })
  },

  // 导出客服信息 Excel
  exportCustomServiceInfo: async (params) => {
    return await request.download({ url: `/server/custom-service-info/export-excel`, params })
  }
}