import { cdcmRequestClient } from './request';

export interface action {
  code: number;
}

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

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

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

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