feat: 新增客户端作品展示模块

This commit is contained in:
Nixevol
2026-07-19 08:51:07 +08:00
parent afc087a925
commit 467c5a1de5
19 changed files with 790 additions and 72 deletions
@@ -38,11 +38,18 @@ export class PublicTraceService {
@Inject(REDIS_CLIENT) private readonly redis: Redis,
) {}
private mapMedia(items: unknown) {
private mapMedia(
items: unknown,
): Array<{ name?: string; type?: string; description?: string; url: string }> {
if (!Array.isArray(items)) return [];
return (items as Array<{ key: string; name?: string; type?: string }>)
return (items as Array<{ key: string; name?: string; type?: string; description?: string }>)
.filter((i) => i && i.key)
.map((i) => ({ name: i.name, type: i.type, url: this.storage.getUrl(i.key) }));
.map((i) => ({
name: i.name,
type: i.type,
description: i.description,
url: this.storage.getUrl(i.key),
}));
}
private buildTimeline(
@@ -320,6 +327,7 @@ export class PublicTraceService {
artist: artwork.artist,
archiveNo: artwork.archiveNo,
images: this.mapMedia(artwork.images),
showcaseImages: this.mapMedia(artwork.showcaseImages),
showOutboundTimeline: artwork.showOutboundTimeline,
fields: this.buildFields(artwork.template.fields, artwork.dynamicFields),
},