import request from '../utils/request'

const api = {
  Account: '/Lepao/Account',
  UpdateSelfAccount: '/Lepao/Account/UpdateSelfAccount',
  AdminUpdateAccountInfo: '/Admin/Lepao/Account/UpdateAccountInfo',
  AdminAccount: '/Admin/Lepao/Account',
  CountLedgerMyList: '/Lepao/Count/Ledger/MyList',
  CountLedgerAdminList: '/Admin/Lepao/Count/Ledger/List',
  Records: '/Lepao/Records',
  OfficialTermRecords: '/Lepao/OfficialTermRecords',
  ChangeAutoRun: '/Lepao/ChangeAutoRun',
  SingleRun: '/Lepao/SingleRun',
  GetRecordDetail: '/Lepao/GetRecordDetail',
  AdminRecords: '/Admin/Lepao/Records',
  AdminOfficialTermRecords: '/Admin/Lepao/OfficialTermRecords',
  AdminGetRecordDetail: '/Admin/Lepao/GetRecordDetail',
  BeginFaceReco: '/Face/BeginFaceReco',
  BindAuditList: '/Lepao/BindAudit/List',
  AdminBindAuditByAccount: '/Admin/Lepao/BindAudit/ByAccount',
  AdminBindAuditList: '/Admin/Lepao/BindAudit/List'
}

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 updateSelfAccount (parameter) {
  return request({
    url: api.UpdateSelfAccount,
    method: 'post',
    data: parameter
  })
}

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

export function adminUpdateAccountInfo (parameter) {
  return request({
    url: api.AdminUpdateAccountInfo,
    method: 'post',
    data: 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 officialTermRecords (parameter) {
  return request({
    url: api.OfficialTermRecords,
    method: 'get',
    params: parameter
  })
}

export function adminOfficialTermRecords (parameter) {
  return request({
    url: api.AdminOfficialTermRecords,
    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
  })
}

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

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

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

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