按后台配置扣除创作泥点
前端创作表单泥点预校验改为读取入口契约配置 拼图和抓大鹅初始生成后端扣费改为解析后台配置 汪汪声浪初始三图生成按入口总成本拆分扣费 创作工作台按钮和确认弹窗展示后台配置泥点成本 补充泥点扣费回归测试并同步文档与共享记忆
This commit is contained in:
@@ -172,6 +172,7 @@ describe('barkBattleCreationClient', () => {
|
||||
body: JSON.stringify({
|
||||
slot: 'player-character',
|
||||
draftId: 'draft-1',
|
||||
billingPurpose: null,
|
||||
config: {
|
||||
title: '汪汪冠军杯',
|
||||
description: '',
|
||||
@@ -224,5 +225,16 @@ describe('barkBattleCreationClient', () => {
|
||||
'opponent-character': '泥点不足,本次需要 1 泥点,当前 0 泥点。',
|
||||
'ui-background': '场景图片生成失败:上游超时',
|
||||
});
|
||||
expect(requestJsonMock).toHaveBeenNthCalledWith(
|
||||
1,
|
||||
'/api/creation/bark-battle/images/generate',
|
||||
expect.objectContaining({
|
||||
body: expect.stringContaining(
|
||||
'"billingPurpose":"initial_draft_generation"',
|
||||
),
|
||||
}),
|
||||
'生成汪汪声浪素材失败',
|
||||
expect.anything(),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -376,10 +376,12 @@ export function regenerateBarkBattleImageAsset(payload: {
|
||||
slot: BarkBattleAssetSlot;
|
||||
config: BarkBattleConfigEditorPayload;
|
||||
draftId?: string | null;
|
||||
billingPurpose?: BarkBattleImageAssetGenerateRequest['billingPurpose'];
|
||||
}): Promise<BarkBattleGeneratedImageAsset> {
|
||||
const request: BarkBattleImageAssetGenerateRequest = {
|
||||
slot: payload.slot,
|
||||
draftId: payload.draftId ?? null,
|
||||
billingPurpose: payload.billingPurpose ?? null,
|
||||
config: payload.config,
|
||||
};
|
||||
return requestJson<BarkBattleGeneratedImageAsset>(
|
||||
@@ -418,6 +420,7 @@ export async function generateAllBarkBattleImageAssets(payload: {
|
||||
slot,
|
||||
config: payload.config,
|
||||
draftId: payload.draftId,
|
||||
billingPurpose: 'initial_draft_generation',
|
||||
}),
|
||||
slot,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user