diff --git a/account_resource/__pycache__/product_interface.cpython-310.pyc b/account_resource/__pycache__/product_interface.cpython-310.pyc new file mode 100644 index 0000000..50f58ca Binary files /dev/null and b/account_resource/__pycache__/product_interface.cpython-310.pyc differ diff --git a/account_resource/product_interface.py b/account_resource/product_interface.py index 7df21af..1bae003 100644 --- a/account_resource/product_interface.py +++ b/account_resource/product_interface.py @@ -134,10 +134,21 @@ async def execute_product_service(resource_ref_id, user_id, user_org_id, request getattr(spec, 'spec_code'), charge_mode, user_id, user_org_id, subscription_id=(request_data or {}).get('subscription_id', ''), quantity=(request_data or {}).get('quantity', 1)) + # 权益信息(供产品层写 product_subscription) + days = {'trial': 7, 'month': 30, 'year': 365}.get(charge_mode, 30) return {'success': True, - 'message': '账号开通成功(权益生效逻辑待接入)', + 'message': '账号开通成功', 'status': 'SUCCESS', - 'usage': rec} + 'usage': rec, + 'entitlement': { + 'charge_mode': charge_mode, + 'duration_days': days, + 'workspace_max': int(getattr(spec, 'workspace_max', 0) or 0), + 'workspace_gb': float(getattr(spec, 'workspace_gb', 0) or 0), + 'concurrent_task': int(getattr(spec, 'concurrent_task', 0) or 0), + 'member_max': int(getattr(spec, 'member_max', 0) or 0), + 'gpu_allowed': getattr(spec, 'gpu_allowed', '') or '', + }} async def execute_product_service_stream(resource_ref_id, user_id, user_org_id, request_data):