import request from '../utils/request'

const api = {
  Account: '/Lepao/Account',
  AdminAccount: '/Admin/Lepao/Account',
  Records: '/Lepao/Records',
  ChangeAutoRun: '/Lepao/ChangeAutoRun',
  SingleRun: '/Lepao/SingleRun',
  GetRecordDetail: '/Lepao/GetRecordDetail',
  AdminRecords: '/Admin/Lepao/Records',
  AdminGetRecordDetail: '/Admin/Lepao/GetRecordDetail',
  BeginFaceReco: '/Face/BeginFaceReco'
}

export function addAccount (parameter) {
  return request({
    url: api.Account,
    method: 'post',
    data: parameter
  })
}

export function accountList (parameter) {
  return request({
    url: api.Account,
    method: 'get',
    params: parameter
  })
}

export function adminAccountList (parameter) {
  return request({
    url: api.AdminAccount,
    method: 'get',
    params: parameter
  })
}

export function deleteAccount (parameter) {
  return request({
    url: api.Account,
    method: 'delete',
    data: parameter
  })
}

export function lepaoRecords (parameter) {
  return request({
    url: api.Records,
    method: 'get',
    params: parameter
  })
}

export function adminLepaoRecords (parameter) {
  return request({
    url: api.AdminRecords,
    method: 'get',
    params: parameter
  })
}

export function changeAutoRun (parameter) {
  return request({
    url: api.ChangeAutoRun,
    method: 'get',
    params: parameter
  })
}

export function singleRun (parameter) {
  return request({
    url: api.SingleRun,
    method: 'get',
    params: parameter
  })
}

export function GetRecordDetail (parameter) {
  return request({
    url: api.GetRecordDetail,
    method: 'get',
    params: parameter
  })
}

export function adminGetRecordDetail (parameter) {
  return request({
    url: api.AdminGetRecordDetail,
    method: 'get',
    params: parameter
  })
}

export function BeginFaceReco (parameter) {
  return request({
    url: api.BeginFaceReco,
    method: 'post',
    data: parameter
  })
}