import http from "./http";

export interface RankItem {
  createTime: string;
  creatorId: null;
  creatorName: string;
  id: number;
  name: string;
  phone: string;
  score: number;
  time: number;
  updateTime: string;
  rank: number;
}

export interface RankDescItem {
  score: number;
  time: number;
  rank: number;
  phone?: string;
  isCurrentUser?: boolean;
}

export interface SaveScoreData {
  name: string;
  phone: string;
  score: number;
  time: number;
}

export const getRankList = () => {
  return http.get("/api/show/score/sort");
};

export const saveScore = (data: SaveScoreData) => {
  return http.post("/api/show/score/save", data);
};