import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type Result = {
  msg: any;
  success: boolean;
  data?: {
    person?: Array<any>;
    car?: Array<any>;
  };
};
type Data = {
  success: boolean;
  msg: any;
  count: number;
  results?: Array<any>;
  code: number;
};

export const getPicList = (params?: object) => {
  return http.request<Result>("get", baseUrlApi("tps/pics/"), { params });
};
export const getTPList = (params?: object) => {
  return http.request<Data>("get", baseUrlApi("tps/"), { params });
};

export const submitAnalyse = (data?: object) => {
  return http.request<Data>("post", baseUrlApi("tps/analysis_video/"), {
    data
  });
};

export const getVideoList = (data?: object) => {
  return http.request<Data>("post", baseUrlApi("tps/get_analyzed_videos/"), {
    data
  });
};

export const beforeUploadVideo = (params?: object) => {
  return http.request<Data>("get", baseUrlApi("tps/upload_video/"), {
    params
  });
};
