- 使用真实讲解编号解析接口替换本地演示映射 - 成功后复用现有详情页并自动播放讲解 - 增加查询状态、业务错误提示和相关测试 Made-with: Proma
This commit is contained in:
@@ -78,6 +78,11 @@ export interface ExplainHallSummary {
|
||||
guideStopCount: number
|
||||
}
|
||||
|
||||
export interface ExplainCodeResolution {
|
||||
code: string
|
||||
stopId: string
|
||||
}
|
||||
|
||||
export class ExplainUseCase {
|
||||
constructor(
|
||||
private readonly explain: ExplainRepository = explainRepository,
|
||||
@@ -273,6 +278,15 @@ export class ExplainUseCase {
|
||||
})
|
||||
}
|
||||
|
||||
async resolveExplainCode(code: string, lang: AudioLanguage = dataSourceConfig.audioLanguage as AudioLanguage): Promise<ExplainCodeResolution> {
|
||||
const stopInfo = await this.audioPlayInfo.getStopInfoByCode(code, lang)
|
||||
const stopId = stopInfo.resolvedStopId || stopInfo.playTargetId || stopInfo.targetId
|
||||
if (!stopInfo.available || !stopId) {
|
||||
throw new Error('该编号的讲解内容暂不可用')
|
||||
}
|
||||
return { code: code.trim(), stopId }
|
||||
}
|
||||
|
||||
async enterExplainDetail(request: ExplainDetailEntryRequest) {
|
||||
const stopId = this.resolveDetailStopId(request)
|
||||
if (!stopId) throw new Error('讲解点 ID 不能为空')
|
||||
|
||||
Reference in New Issue
Block a user