feat(storage): 广告对象键布局(staging + 版本化终键)
adsStagingObjectKey(两步上传 presignPut 直传位)+ adObjectKey (版本段=entityVersion:换图必然 bump 版本→新键,copyIfAbsent 禁止覆盖语义下天然防重复/防串图);index.ts 按名再导出供 Task 6/7 ads.service 消费。设计方案 §2.1/§3 终键布局同步回填(偏差登记)。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,8 @@ export {
|
||||
OBJECT_KEY_ROOT,
|
||||
variantsObjectKey,
|
||||
watermarkVariantObjectKey,
|
||||
adsStagingObjectKey,
|
||||
adObjectKey,
|
||||
} from './keys';
|
||||
export type { PhotoVariantName } from './keys';
|
||||
|
||||
|
||||
@@ -33,3 +33,14 @@ export function watermarkVariantObjectKey(
|
||||
): string {
|
||||
return variantsObjectKey(albumId, photoId, configVersion, 'watermark');
|
||||
}
|
||||
|
||||
/** 广告图 staging 键(两步上传第一步:presignPut 直传位)。 */
|
||||
export function adsStagingObjectKey(cuid: string, ext: string): string {
|
||||
return `${OBJECT_KEY_ROOT}/ads/staging/${cuid}.${ext}`;
|
||||
}
|
||||
|
||||
/** 广告图终键(版本段=entityVersion:换图必然 bump 版本 → 新键,
|
||||
* copyIfAbsent 禁止覆盖语义下天然防重复/防串图)。 */
|
||||
export function adObjectKey(adId: string, version: number, ext: string): string {
|
||||
return `${OBJECT_KEY_ROOT}/ads/${adId}/v${version}.${ext}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user