import fetch from './fetch';

// login
export const wxAuth = entity =>
  fetch({
    url: '/login/weChatAuthorization',
    params: entity,
  });
export const getVcode = entity =>
  fetch({
    url: '/login/getCode',
    params: entity,
  });
export const sendMsg = entity =>
  fetch({
    url: '/login/sendMsg',
    params: entity,
  });
export const login = entity =>
  fetch({
    url: '/login/app/login.do',
    method: 'post',
    data: entity,
  });

// base
export const fetchRepairArea = () =>
  fetch({
    url: '/baseData/getBaseData',
    params: { type: 1 },
  });
export const fetchRepairTerm = () =>
  fetch({
    url: '/baseData/getBaseData',
    params: { type: 2 },
  });
export const fetchCarCategory = () =>
  fetch({
    url: '/baseData/getBaseData',
    params: { type: 3 },
  });
export const fetchCarPlateList = () =>
  fetch({
    url: '/baseData/getBaseData',
    params: { type: 4 },
  });
// publicCar
export const fetchPublicCarList = entity =>
  fetch({
    url: '/publicCar/app/teacherAppoCar4AppPage',
    method: 'post',
    data: entity,
  });

export const applyPublicCar = entity =>
  fetch({
    url: '/publicCar/app/teacherAppoCar4Add',
    method: 'post',
    data: entity,
  });

export const fetchApplyPublicCarList = entity =>
  fetch({
    url: '/publicCar/app/teacherAppoCar4AppPageAdmin',
    method: 'post',
    data: entity,
  });

export const dealPublicCar = entity =>
  fetch({
    url: '/publicCar/app/teacherAppoCar4AppDeal',
    method: 'post',
    data: entity,
  });

// repair
export const fetchRepairList = entity =>
  fetch({
    url: '/repair/app/pageList4Repair',
    method: 'post',
    data: entity,
  });

export const reportRepair = entity =>
  fetch({
    url: '/repair/app/addRepair',
    method: 'post',
    data: entity,
  });
export const fetchReportRepairList = entity =>
  fetch({
    url: '/repair/app/pageListAdmin4Repair',
    method: 'post',
    data: entity,
  });
export const dealRepair = entity =>
  fetch({
    url: '/repair/app/deal4Repair',
    method: 'post',
    data: entity,
  });
