index.ts 813 B

12345678910111213141516171819202122232425
  1. // API List
  2. // /dashboard/shutdownStatistics/date - GET shutdown统计最新日期
  3. // /dashboard/shutdownStatistics - GET shutdown统计
  4. import http from '@/service/serverReq'
  5. import type { ShutdownStatisticsInfo } from './interface'
  6. const API_List = {
  7. shutdownStatisticsDate: '/dashboard/shutdownStatistics/date',
  8. shutdownStatistics: '/dashboard/shutdownStatistics',
  9. }
  10. // GET shutdown统计最新日期
  11. export const getShutdownStatisticsDate = async (): Promise<string> => {
  12. const res = await http.get<string>(API_List.shutdownStatisticsDate)
  13. return res
  14. }
  15. // GET shutdown统计
  16. export const getShutdownStatistics = async (date: string): Promise<ShutdownStatisticsInfo> => {
  17. const res = await http.get<ShutdownStatisticsInfo>(API_List.shutdownStatistics, {
  18. params: { date },
  19. })
  20. return res
  21. }