推进活动系统最小成品闭环与游客体验

This commit is contained in:
2026-04-07 19:05:18 +08:00
parent 1a6008449e
commit 6cd16f08dd
102 changed files with 16087 additions and 3556 deletions

View File

@@ -63,12 +63,92 @@ export interface BackendPresentationSummary {
version?: string | null
}
export interface BackendPreviewControlSummary {
id?: string | null
label?: string | null
kind?: string | null
lon?: number | null
lat?: number | null
}
export interface BackendPreviewLegSummary {
fromLon?: number | null
fromLat?: number | null
toLon?: number | null
toLat?: number | null
}
export interface BackendPreviewVariantSummary {
variantId?: string | null
id?: string | null
name?: string | null
routeCode?: string | null
controls?: BackendPreviewControlSummary[] | null
legs?: BackendPreviewLegSummary[] | null
}
export interface BackendPreviewSummary {
mode?: string | null
baseTiles?: {
tileBaseUrl?: string | null
zoom?: number | null
tileSize?: number | null
} | null
viewport?: {
width?: number | null
height?: number | null
minLon?: number | null
minLat?: number | null
maxLon?: number | null
maxLat?: number | null
} | null
variants?: BackendPreviewVariantSummary[] | null
selectedVariantId?: string | null
}
export interface BackendContentBundleSummary {
bundleId?: string | null
bundleType?: string | null
version?: string | null
}
export interface BackendExperienceMapSummary {
placeId?: string | null
placeName?: string | null
mapId?: string | null
mapName?: string | null
coverUrl?: string | null
summary?: string | null
defaultExperienceCount?: number | null
defaultExperienceEventIds?: string[] | null
}
export interface BackendDefaultExperienceSummary {
eventId?: string | null
title?: string | null
subtitle?: string | null
eventType?: string | null
status?: string | null
statusCode?: string | null
ctaText?: string | null
isDefaultExperience?: boolean
showInEventList?: boolean
currentPresentation?: BackendPresentationSummary | null
currentContentBundle?: BackendContentBundleSummary | null
}
export interface BackendExperienceMapDetail {
placeId?: string | null
placeName?: string | null
mapId?: string | null
mapName?: string | null
coverUrl?: string | null
summary?: string | null
tileBaseUrl?: string | null
tileMetaUrl?: string | null
defaultExperiences?: BackendDefaultExperienceSummary[] | null
}
export interface BackendEntrySessionSummary {
id: string
status: string
@@ -151,6 +231,7 @@ export interface BackendEventPlayResult {
}
currentPresentation?: BackendPresentationSummary | null
currentContentBundle?: BackendContentBundleSummary | null
preview?: BackendPreviewSummary | null
release?: {
id: string
configLabel: string
@@ -188,6 +269,7 @@ export interface BackendLaunchResult {
}
business: {
source: string
isGuest?: boolean
eventId: string
sessionId: string
sessionToken: string
@@ -348,6 +430,17 @@ export function getEventPlay(input: {
})
}
export function getPublicEventPlay(input: {
baseUrl: string
eventId: string
}): Promise<BackendEventPlayResult> {
return requestBackend<BackendEventPlayResult>({
method: 'GET',
baseUrl: input.baseUrl,
path: `/public/events/${encodeURIComponent(input.eventId)}/play`,
})
}
export function getEntryHome(input: {
baseUrl: string
accessToken: string
@@ -391,6 +484,32 @@ export function launchEvent(input: {
})
}
export function launchPublicEvent(input: {
baseUrl: string
eventId: string
releaseId?: string
variantId?: string
clientType: string
deviceKey: string
}): Promise<BackendLaunchResult> {
const body: Record<string, unknown> = {
clientType: input.clientType,
deviceKey: input.deviceKey,
}
if (input.releaseId) {
body.releaseId = input.releaseId
}
if (input.variantId) {
body.variantId = input.variantId
}
return requestBackend<BackendLaunchResult>({
method: 'POST',
baseUrl: input.baseUrl,
path: `/public/events/${encodeURIComponent(input.eventId)}/launch`,
body,
})
}
export function startSession(input: {
baseUrl: string
sessionId: string
@@ -463,3 +582,49 @@ export function postClientLog(input: {
body: input.payload as unknown as Record<string, unknown>,
})
}
export function getExperienceMaps(input: {
baseUrl: string
accessToken: string
}): Promise<BackendExperienceMapSummary[]> {
return requestBackend<BackendExperienceMapSummary[]>({
method: 'GET',
baseUrl: input.baseUrl,
path: '/experience-maps',
authToken: input.accessToken,
})
}
export function getPublicExperienceMaps(input: {
baseUrl: string
}): Promise<BackendExperienceMapSummary[]> {
return requestBackend<BackendExperienceMapSummary[]>({
method: 'GET',
baseUrl: input.baseUrl,
path: '/public/experience-maps',
})
}
export function getExperienceMapDetail(input: {
baseUrl: string
accessToken: string
mapAssetId: string
}): Promise<BackendExperienceMapDetail> {
return requestBackend<BackendExperienceMapDetail>({
method: 'GET',
baseUrl: input.baseUrl,
path: `/experience-maps/${encodeURIComponent(input.mapAssetId)}`,
authToken: input.accessToken,
})
}
export function getPublicExperienceMapDetail(input: {
baseUrl: string
mapAssetId: string
}): Promise<BackendExperienceMapDetail> {
return requestBackend<BackendExperienceMapDetail>({
method: 'GET',
baseUrl: input.baseUrl,
path: `/public/experience-maps/${encodeURIComponent(input.mapAssetId)}`,
})
}