讲解对象列表接入展厅分页接口
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-17 18:27:24 +08:00
parent 7267dfcac1
commit cf6ad02318
18 changed files with 682 additions and 409 deletions

View File

@@ -2,6 +2,7 @@ import type {
AudioPlayTargetType,
ExplainBusinessUnit,
ExplainGuideStop,
ExplainGuideStopPage,
ExplainTrack,
MediaAsset,
MuseumExhibit,
@@ -67,7 +68,6 @@ export interface ExhibitDetailAudioOptions {
export interface ExplainHallSummary {
hallId: string
businessUnitCount: number
guideStopCount: number
}
@@ -487,24 +487,20 @@ export class ExplainUseCase {
if (hall && (typeof hall.outlineCount === 'number' || typeof hall.stopCount === 'number')) {
return [hallId, {
hallId,
businessUnitCount: hall.outlineCount || 0,
guideStopCount: hall.stopCount || 0
}] as const
}
try {
const units = await this.loadTemporaryBusinessUnitsByHall(hallId)
const guideStopCount = units.reduce((total, unit) => total + unit.guideStopCount, 0)
const page = await this.listGuideStopsPageByHall(hallId, 1, 1)
return [hallId, {
hallId,
businessUnitCount: units.length,
guideStopCount
guideStopCount: page.total
}] as const
} catch (error) {
console.warn('讲解展厅统计加载失败:', hallId, error)
return [hallId, {
hallId,
businessUnitCount: 0,
guideStopCount: 0
}] as const
}
@@ -513,6 +509,10 @@ export class ExplainUseCase {
return Object.fromEntries(entries)
}
listGuideStopsPageByHall(hallId: string, pageNo: number, pageSize: number): Promise<ExplainGuideStopPage> {
return this.explain.listGuideStopsPageByHall(hallId, pageNo, pageSize)
}
getHallById(id: string) {
return this.explain.getHallById(id)
}