import { cdcmRequestClient } from './request';

export async function cdcmCDCMAPI(params, key) {
  return cdcmRequestClient.post('/cdcm', params, {
    responseReturn: 'data',
    headers: {
      action: key.code,
    },
  });
}

export async function cdcmRuleAPI(params, key) {
  return cdcmRequestClient.post('/rule', params, {
    responseReturn: 'data',
    headers: {
      action: key.code,
    },
  });
}
export async function cdcmTemplateAPI(params, key) {
  return cdcmRequestClient.post('/template', params, {
    headers: {
      action: key.code,
    },
  });
}

export async function cdcmDriverAPI(params, key) {
  return cdcmRequestClient.post('/driver', params, {
    headers: {
      action: key.code,
    },
  });
}

export async function cdcmDataAPI(params, key) {
  return cdcmRequestClient.post('/data', params, {
    headers: {
      action: key.code,
    },
  });
}
