优化商店个性装扮体验

This commit is contained in:
2026-04-27 11:12:51 +08:00
parent 32af6abeb2
commit ffccfa26e9
14 changed files with 1027 additions and 20 deletions
+11
View File
@@ -16,6 +16,13 @@ use Illuminate\Support\Facades\DB;
class ShopService
{
/**
* @param DecorationService $decorationService 装扮服务
*/
public function __construct(
private readonly DecorationService $decorationService,
) {}
/**
* 购买商品入口:扣金币、按类型分发处理
*
@@ -41,6 +48,10 @@ class ShopService
'ring' => $this->buyRing($user, $item),
'auto_fishing' => $this->buyAutoFishingCard($user, $item),
ShopItem::TYPE_SIGN_REPAIR => $this->buySignRepairCard($user, $item, $quantity),
// ── 个人装扮购买(委托给 DecorationService)───────────────
'msg_bubble' => $this->decorationService->purchase($user, $item),
'msg_name_color' => $this->decorationService->purchase($user, $item),
'avatar_frame' => $this->decorationService->purchase($user, $item),
default => ['ok' => false, 'message' => '未知商品类型'],
};
}