fetchRoom.ts 858 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { GET_ROOM } from '../utils/apiList'
  2. import { request, Response } from '../utils/http'
  3. interface sceneType {
  4. num: string
  5. }
  6. export interface RoomDetailType {
  7. createTime: string
  8. isShow: number
  9. lastLookTime: string
  10. roomCoverUrl: string
  11. roomHostCode: string
  12. roomHostName: string
  13. roomId: string
  14. roomInfo: string
  15. roomShareCode: string
  16. roomShareUrl: string
  17. roomStatus: number
  18. roomTitle: string
  19. roomUserName: string
  20. roomViewCount: number
  21. sceneData: sceneType[]
  22. tbStatus: number
  23. isHost: number
  24. updateTime: string
  25. hostStatus?: number
  26. }
  27. type RoomDetailRes = Response & {
  28. data: RoomDetailType
  29. }
  30. export const fetchRoom = async (roomId: string): Promise<RoomDetailType> => {
  31. const res = await request.get<RoomDetailRes>(GET_ROOM, {
  32. roomId: roomId
  33. })
  34. return res.data
  35. }