Resource group service list sorted in descending order of creation time

This commit is contained in:
Liujian committed 2025-12-22 11:07:54 +08:00
1 parent 8abc7469cd
commit dab04242e6
7 files changed
+15 -14

No files matched your search

@@ -223,11 +223,7 @@ def get_mcp_service_list(
"slug_name": service.slug_name,
"short_description": service.short_description,
"long_description": service.long_description,
# "auth_method": service.auth_method.value if service.auth_method else None,
"base_url": service.base_url,
# "headers": json.loads(service.headers) if service.headers else [],
# "auth_header": service.auth_header,
# "auth_token": service.auth_token,
"charge_type": service.charge_type.value if service.charge_type else None,
"price": str(float(service.price)) if service.price and service.charge_type == ChargeType.PER_CALL else "0.00",
"input_token_price": str(float(service.input_token_price)) if service.input_token_price and service.charge_type == ChargeType.PER_TOKEN else "0.00",
@@ -46,7 +46,6 @@ def get_user(request: Request, user_wallet: UserWalletService = Depends(get_user
elif user.group_id == "deny-all":
user_response.allow_all = False
else:
print("user group id is:",user.group_id)
service_ids = resource_group_service.get_bind_service_ids(user.group_id)
user_response.service_ids = service_ids
user_response.user_id = user.id
@@ -132,7 +132,6 @@ async def recharge_balance(
# calculate md5 hash of the body and timestamp
md5_hash = hashlib.md5(f"{timestamp}{body_str}".encode('utf-8')).hexdigest()
calculated_sign = hashlib.sha256(md5_hash.encode('utf-8')).hexdigest()
print(f"sign: {sign}, calculated_sign: {calculated_sign},md5_hash: {md5_hash}")
if sign != calculated_sign:
return ResponseUtils.error(message="Invalid signature")
try:
@@ -147,7 +146,6 @@ async def recharge_balance(
transaction_id = hashlib.md5(f"{timestamp}{user_id}{balance}{typ}".encode('utf-8')).hexdigest()
if payment_service.check_transaction_id_exists(transaction_id):
return ResponseUtils.error(message="Transaction ID already exists")
print(f"user_id: {user_id}, amount: {balance}, typ: {typ}, transaction_id: {transaction_id}")
success = payment_service.platform_payment(user_id=user_id, amount=balance, typ=typ, transaction_id=transaction_id)
if not success:
return ResponseUtils.error(message="Failed to recharge wallet balance")