import httpClient from '@/utils/http';

import {
  BatchRecognizeRequest,
  CreateTemplateResponseApiResult,
  DeleteTemplateResponseApiResult,
  DirectRecognizeRequest,
  DirectRecognizeResponseApiResult,
  GetTemplateResponseApiResult,
  StringApiResult,
  TemplateInfo,
  TemplateListResponseApiResult,
  TemplateModifyRequest,
  TemplateModifyResponseApiResult,
  TemplateRecognizeRequest,
  TemplateRecognizeResponseApiResult,
  UpdateFrontBackAreaRequest,
  UpdateFrontBackAreaResponseApiResult
} from './data-contracts';
export default {
  /**
   * No description
   */
  templateRecognizeCreate: (data: TemplateRecognizeRequest) => {
    return httpClient.post<TemplateRecognizeResponseApiResult>(`/api/template/recognize`, {
      params: data
    });
  },
  /**
   * No description
   */
  templateModifyCreate: (data: TemplateModifyRequest) => {
    return httpClient.post<TemplateModifyResponseApiResult>(`/api/template/modify`, {
      params: data
    });
  },
  /**
   * No description
   */
  templateUpdateFrontBackAreaCreate: (data: UpdateFrontBackAreaRequest) => {
    return httpClient.post<UpdateFrontBackAreaResponseApiResult>(
      `/api/template/update_front_back_area`,
      { params: data }
    );
  },
  /**
   * No description
   */
  templateBatchRecognizeCreate: (data: BatchRecognizeRequest) => {
    return httpClient.post<StringApiResult>(`/api/template/batch/recognize`, { params: data });
  },
  /**
   * No description
   */
  templateCreate: (data: TemplateInfo) => {
    return httpClient.post<CreateTemplateResponseApiResult>(`/api/template`, { params: data });
  },
  /**
   * No description
   */
  templateList: () => {
    return httpClient.get<TemplateListResponseApiResult>(`/api/template`);
  },
  /**
   * No description
   */
  templateDetail: (id: string) => {
    return httpClient.get<GetTemplateResponseApiResult>(`/api/template/${id}`);
  },
  /**
   * No description
   */
  templateDelete: (id: string) => {
    return httpClient.delete<DeleteTemplateResponseApiResult>(`/api/template/${id}`);
  },
  /**
   * No description
   */
  templateDirectRecognizeCreate: (data: DirectRecognizeRequest) => {
    return httpClient.post<DirectRecognizeResponseApiResult>(`/api/template/direct/recognize`, {
      params: data
    });
  }
};
