fetchRoom.ts 833 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. }
  26. type RoomDetailRes = Response & {
  27. data: RoomDetailType
  28. }
  29. export const fetchRoom = async (roomId: string): Promise<RoomDetailType> => {
  30. const res = await request.get<RoomDetailRes>(GET_ROOM, {
  31. roomId: roomId
  32. })
  33. return res.data
  34. }