import axiosApi from './AxiosApi.js'

const apiList = {
  getLabelList: `/memberTag/page`,
  addLabel: `/memberTag`,
  queryTag: `/memberTag/queryTag/`,
  deleteTag: `/memberTag`,
  editTag: `/memberTag`,
  exportTag: `/memberTag/export`,
  getTagInfo: `/memberTag/`
}
export default {
  // 标签列表
  getLabelList(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.getLabelList,
      data
    })
  },
  // 新建标签
  addLabel(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.addLabel,
      data
    })
  },
  // 查询客户标签
  queryTag(id) {
    return axiosApi({
      method: 'GET',
      url: `${apiList.queryTag}${id}`
    })
  },
  // 删除标签
  deleteTag(data) {
    return axiosApi({
      method: 'DELETE',
      url: apiList.deleteTag,
      data
    })
  },
  // 修改标签
  editTag(data) {
    return axiosApi({
      method: 'PUT',
      url: apiList.editTag,
      data
    })
  },
  // 导出标签
  exportTag(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.exportTag,
      data
    })
  },
  // 查询标签详情
  getTagInfo(id) {
    return axiosApi({
      method: 'GET',
      url: `${apiList.getTagInfo}${id}`
    })
  }
}
