|
|
@@ -1,17 +1,38 @@
|
|
|
|
|
|
|
|
|
-import { WX_LOGIN } from '../utils/apiList'
|
|
|
+import { GET_HOME_ROOM_LIST } from '../utils/apiList'
|
|
|
import { request, Response } from '../utils/http'
|
|
|
|
|
|
-interface LoginResType {
|
|
|
- token: string
|
|
|
+
|
|
|
+interface parmams {
|
|
|
+ pageNum?: number,
|
|
|
+ pageSize?: number
|
|
|
+}
|
|
|
+
|
|
|
+export interface ListItem {
|
|
|
+ createTime: string
|
|
|
+ lastLookTime: string
|
|
|
+ roomCoverUrl: string
|
|
|
+ roomHostCode: string
|
|
|
+ roomHostName: string
|
|
|
+ roomId: string
|
|
|
+ roomInfo: string
|
|
|
+ roomShareCode: number
|
|
|
+ roomShareUrl: string
|
|
|
+ roomStatus: number
|
|
|
+ roomTitle: string
|
|
|
+ roomUserName: string
|
|
|
+ roomViewCount: number
|
|
|
+ tbStatus: number
|
|
|
+ updateTime: string
|
|
|
}
|
|
|
-type RoomDetailRes = Response & {
|
|
|
- data: LoginResType
|
|
|
+type RoomListRes = Response & {
|
|
|
+ data: ListItem[]
|
|
|
}
|
|
|
-export const login = async (code: string): Promise<LoginResType> => {
|
|
|
- const res = await request.get<RoomDetailRes>(WX_LOGIN, {
|
|
|
- code
|
|
|
+export const getHomeRoomList = async (params: parmams): Promise<ListItem[]> => {
|
|
|
+ const res = await request.get<RoomListRes>(GET_HOME_ROOM_LIST, {
|
|
|
+ pageNum: params.pageNum || 1,
|
|
|
+ pageSize: params.pageSize || 1000
|
|
|
})
|
|
|
return res.data
|
|
|
|