feat(albums): soft-delete albums (admin+owner, hidden & irreversible, both app entries)

契约 deleteAlbum(DELETE /albums/{albumId} → 204 幂等)+ status enum 'deleted':
- 服务端:softDelete(canView 404→canManage 403 防枚举;乐观锁 claim +
  outbox album.updated priority=high + audit album.delete);列表/详情/更新/
  成员/资产/分类/水印/照片/展示位绑定全部 deleted→404;公开端 cn
  (status!=='active')与 ov(isAlbumVisibleOv)天然屏蔽;ov 副本经
  album.updated 载荷 status 直投自动下线
- Admin:列表表格操作「删除」+ 详情页头「删除相册」(确认含不可恢复说明)
- App:操作面板「删除相册」(红字、二次确认、成功退回列表并刷新)
- 验证:API 56/56、App 397/397(analyze 0)、admin typecheck/lint/test/build 绿

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-23 10:13:08 +08:00
parent 9cb960c27a
commit 8e674a902e
31 changed files with 995 additions and 258 deletions
+35 -3
View File
@@ -267,6 +267,34 @@ paths:
/albums/{albumId}:
parameters:
- $ref: '#/components/parameters/AlbumId'
delete:
operationId: deleteAlbum
tags: [albums]
summary: 软删除相册
description: >-
标记 status=deleted(软删除):管理端列表与公开端即刻不可见,成员/上传/
资产等全部子资源随之 404;数据保留(物理删除走独立运维流程),不提供
恢复端点。权限同「配置相册」(公司管理员或相册创建者)。事件走
album.updated(priority=high)同步 ov 副本下线。
security:
- bearerAuth: []
responses:
'204':
description: 已删除(幂等:重复删除同样 204)。
'401':
$ref: '#/components/responses/Unauthorized'
'403':
description: 无「配置相册」权限(仅创建者或管理员,AUTH_FORBIDDEN)。
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: 相册不存在(ALBUM_NOT_FOUND,含已删除)。
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
get:
operationId: getAlbum
tags: [albums]
@@ -2781,6 +2809,7 @@ components:
enum:
- active
- offline
- deleted
defaultLocale:
$ref: '#/components/schemas/Locale'
timezone:
@@ -2839,8 +2868,9 @@ components:
description: |
相册封面摘要(UI-01,readOnly 可选扩展):当前生效封面资产
(album_assets kind=cover、state=effective 的最新一行)的短期
签名 URL;未配置封面为 null。列表端点按页批量组装(非逐相册
查询);旧客户端忽略本字段不受影响。
签名 URL;未配置封面为 null。宣传图/封面共用(2026-09-23 决策):
未配置封面时回退最新生效宣传图(传一张即可两用)。列表端点按页
批量组装(非逐相册查询);旧客户端忽略本字段不受影响。
readOnly: true
anyOf:
- $ref: '#/components/schemas/SignedUrl'
@@ -4397,7 +4427,9 @@ components:
items:
$ref: '#/components/schemas/PublicCategory'
banner:
description: 封面图签名 URL;未设置为 null。
description: |
宣传图签名 URL;未设置为 null。宣传图/封面共用(2026-09-23 决策):
未配置宣传图时回退最新生效封面(传一张即可两用)。
anyOf:
- $ref: '#/components/schemas/SignedUrl'
- type: 'null'