import { Service } from '@zenview/micro-basic-library';
import { BaseStore } from '@zenview/micro-basic-library';
import { cache } from '@zenview/micro-utils';
import URL from "./url";

const getHeaders = () => {
  return {
    Authorization: cache.getCache('token', 'session')
  }
}


class Player {
  plateRecommend(data) {
    return Service.$http({
      headers: getHeaders(),
      url: URL.plateRecommend.value,
      data: data,
      method: 'POST',
      requestId: URL.plateRecommend.requestId
    })
  }
  //新的查询接口
  personRecommend(option) {
    return Service.$http({
      headers: getHeaders(),
      url: URL.personRecommend.value,
      method: 'post',
      data: option,
      requestId: URL.personRecommend.requestId
    })
  }
  //根据分组查询标签
  getTagsByCondition(data) {
    return Service.$http({
      headers: getHeaders(),
      url: URL.getTagsByCondition.value,
      method: "post",
      data,
      requestId: URL.getTagsByCondition.requestId,
    })
  }
  /**
   * @desc Url人脸特征值提取
   * @param {Object} data
   */
   getFaceFeature(data) {
    return Service.$http({
      headers: getHeaders(),
      url: URL.getFaceFeature.value,
      method: "post",
      data,
      requestId: URL.getFaceFeature.requestId
    })
  }
  /**
   * @desc Url人脸特征值提取
   * @param {Object} data
   */
   getVehicleFeature(data) {
    return Service.$http({
      headers: getHeaders(),
      url: URL.getVehicleFeature.value,
      method: "post",
      data,
      requestId: URL.getVehicleFeature.requestId
    })
  }
  /**
   * @desc 人员档案上传图片搜索
   * @param {Object} data
   */
   uploadPersonPicture(data) {
    return Service.$httpMultiPartInstance({
      headers: getHeaders(),
      url: URL.uploadPersonPicture.value,
      data: data,
      method: 'POST',
      requestId: URL.uploadPersonPicture.requestId
    })
  }
  //设备推荐的查询接口
  personRecommendPage(option) {
    return Service.$http({
      headers: getHeaders(),
      url: URL.personRecommendPage.value,
      method: 'post',
      data: option,
      requestId: URL.personRecommendPage.requestId
    })
  }
  /**
   * @desc 获取用户的所有设备 全局用 NEW
   * @param {*} data
   */
   queryUserDevicesNew(data) {
    return Service.$http({
      headers: getHeaders(),
      url: URL.queryUserDevicesNew.value,
      method: 'post',
      data,
      requestId: URL.queryUserDevicesNew.requestId
    })
  }
  queryUserDevicesStatusNew(data) {
    return Service.$http({
      headers: getHeaders(),
      url: URL.queryUserDevicesStatusNew.value,
      method: 'post',
      data,
      requestId: URL.queryUserDevicesStatusNew.requestId
    })
  }
  getKvStoreByKey(option) {
    return Service.$http({
      headers: getHeaders(),
      url: URL.getKvStoreByKey.value,
      method: "post",
      data: option,
      requestId: URL.getKvStoreByKey.requestId,
    })
  }
}

export default new Player();
