feat: add api sdk for this

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei
2024-02-14 22:03:29 +08:00
parent cf71fc4f43
commit 4683b697ce
3 changed files with 41 additions and 0 deletions

View File

@@ -82,4 +82,8 @@ export class ActivityController<ResponseWrapper> implements IController {
},
})
}
async getRoomsInfo() {
return this.proxy.rooms.get<{}>()
}
}

View File

@@ -1,3 +1,5 @@
import type { CategoryModel } from './category'
export interface ActivityPresence {
operationTime: number
updatedAt: number
@@ -8,3 +10,37 @@ export interface ActivityPresence {
displayName?: string
}
export interface RoomOmittedNote {
title: string
nid: number
id: string
created: string
}
export interface RoomOmittedPage {
title: string
slug: string
id: string
created: string
}
export interface RoomOmittedPost {
slug: string
title: string
categoryId: string
category: CategoryModel
id: string
created: string
}
export interface RoomsData {
rooms: string[]
roomCount: {
[key: string]: number
}
objects: {
posts: RoomOmittedPost[]
notes: RoomOmittedNote[]
pages: RoomOmittedPage[]
}
}