API.ts 675 B

123456789101112131415161718192021222324252627282930313233343536
  1. import http from "./http";
  2. export interface RankItem {
  3. createTime: string;
  4. creatorId: null;
  5. creatorName: string;
  6. id: number;
  7. name: string;
  8. phone: string;
  9. score: number;
  10. time: number;
  11. updateTime: string;
  12. rank: number;
  13. }
  14. export interface RankDescItem {
  15. score: number;
  16. time: number;
  17. rank: number;
  18. isCurrentUser?: boolean;
  19. }
  20. export interface SaveScoreData {
  21. name: string;
  22. phone: string;
  23. score: number;
  24. time: number;
  25. }
  26. export const getRankList = () => {
  27. return http.get("/api/show/score/sort");
  28. };
  29. export const saveScore = (data: SaveScoreData) => {
  30. return http.post("/api/show/score/save", data);
  31. };