feat(entitlement): execute_product_service 返回账号权益信息(有效期/工作空间配额)
This commit is contained in:
parent
f2972dba74
commit
06bcecafa2
BIN
account_resource/__pycache__/product_interface.cpython-310.pyc
Normal file
BIN
account_resource/__pycache__/product_interface.cpython-310.pyc
Normal file
Binary file not shown.
@ -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,
|
getattr(spec, 'spec_code'), charge_mode, user_id, user_org_id,
|
||||||
subscription_id=(request_data or {}).get('subscription_id', ''),
|
subscription_id=(request_data or {}).get('subscription_id', ''),
|
||||||
quantity=(request_data or {}).get('quantity', 1))
|
quantity=(request_data or {}).get('quantity', 1))
|
||||||
|
# 权益信息(供产品层写 product_subscription)
|
||||||
|
days = {'trial': 7, 'month': 30, 'year': 365}.get(charge_mode, 30)
|
||||||
return {'success': True,
|
return {'success': True,
|
||||||
'message': '账号开通成功(权益生效逻辑待接入)',
|
'message': '账号开通成功',
|
||||||
'status': 'SUCCESS',
|
'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):
|
async def execute_product_service_stream(resource_ref_id, user_id, user_org_id, request_data):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user