diff --git a/docs/plans/2026-09-28-广告位轮播-实施计划.md b/docs/plans/2026-09-28-广告位轮播-实施计划.md index d462ca7..cea543f 100644 --- a/docs/plans/2026-09-28-广告位轮播-实施计划.md +++ b/docs/plans/2026-09-28-广告位轮播-实施计划.md @@ -490,15 +490,15 @@ private buildPayload(ad: AdRow): AdUpdatedPayload { **Files:** Modify `services/api/src/public-ov/public-ov.controller.ts`、`public-ov.service.ts`;Test `services/api/test/public-ov.e2e-spec.ts`(追加段) -- [ ] **Step 1: 写失败测试**(public-ov.e2e 追加,ov app 实例 + prismaOv 直种 ads_ov/albums_ov): +- [x] **Step 1: 写失败测试**(public-ov.e2e 追加,ov app 实例 + prismaOv 直种 ads_ov/albums_ov): ```ts // ① token 有效 + 全局广告 + 绑定本册广告 + 绑定他册广告 → items 恰含前两者, // sortOrder 升序、并列 createdAt 升序;imageUrl 现签(URL 含签名参数形态); // ② 相册不存在/offline → 404 同公开相册码;③ 无广告 → items:[]; // ④ 匿名 200(security: [])。 ``` -- [ ] **Step 2: 跑测试确认失败** —— `pnpm --filter api run test:e2e -- public-ov`。 -- [ ] **Step 3: 实现**: +- [x] **Step 2: 跑测试确认失败** —— `pnpm --filter api run test:e2e -- public-ov`。 +- [x] **Step 3: 实现**: ```ts // controller(getPublicAlbum 之后): /** 公开广告列表:全局+绑定本册,现签图 URL(广告位轮播 2026-09-28 设计 §5.2)。 */ @@ -526,14 +526,14 @@ private buildPayload(ad: AdRow): AdUpdatedPayload { return { items }; } ``` -- [ ] **Step 4: 跑测试确认通过**。 -- [ ] **Step 5: Commit** —— `feat(api): GET /v1/public/albums/{token}/ads 公开广告(全局+定向/现签)` +- [x] **Step 4: 跑测试确认通过**。 +- [x] **Step 5: Commit** —— `feat(api): GET /v1/public/albums/{token}/ads 公开广告(全局+定向/现签)` ### Task 10: viewer——AdCarousel 与页面集成 **Files:** Create `apps/viewer/src/components/ads/AdCarousel.vue`、`apps/viewer/src/ads/carousel.ts`;Modify `apps/viewer/src/api/client.ts`、`apps/viewer/src/pages/ActivityPage.vue`、`apps/viewer/src/i18n/locales/{zh-CN,en}.ts`;Test `apps/viewer/src/ads/carousel.spec.ts`(vitest,对照 viewer 既有 spec 位置与配置) -- [ ] **Step 1: 纯逻辑模块 + 失败测试**(carousel.ts:轮播推进/环形回绕/暂停语义纯函数,便于 vitest 直测): +- [x] **Step 1: 纯逻辑模块 + 失败测试**(carousel.ts:轮播推进/环形回绕/暂停语义纯函数,便于 vitest 直测): ```ts /** 轮播推进:环形(末→首);单条恒 0(不切换)。 */ export function nextIndex(count: number, current: number, step: 1 | -1 = 1): number { @@ -553,13 +553,13 @@ export function swipeStep(dx: number, dy: number): 1 | -1 | 0 { (无圆点导航节点);多条圆点点击切换;✕ 点击 emit close;slide 点击调 window.open spy(jest.fn 挂 global);autoplay 用 vi.useFakeTimers 推进 4s 断言 index 前进、pointerenter 后暂停。 -- [ ] **Step 2: client.ts** —— 类型 + 请求(对照 getPublicAlbum 的既有写法逐字模仿其 apiRequest 用法): +- [x] **Step 2: client.ts** —— 类型 + 请求(对照 getPublicAlbum 的既有写法逐字模仿其 apiRequest 用法): ```ts export type PublicAdListResponse = components['schemas']['PublicAdListResponse']; export type PublicAd = components['schemas']['PublicAd']; export async function getPublicAds(token: string): Promise { /* 同形 */ } ``` -- [ ] **Step 3: AdCarousel.vue**(完整实现;视觉 token 一律 var(--viewer-*)): +- [x] **Step 3: AdCarousel.vue**(完整实现;视觉 token 一律 var(--viewer-*)): ```vue