fix: auto-fix code issues (cron)

- 修复重复导入/字段 (llm_client.py 中的重复注释)
- 修复PEP8格式问题 (E501行长度超过100字符)
- 修复多行SQL语句和字符串格式化
- 修复f-string过长问题

涉及文件:
- backend/developer_ecosystem_manager.py
- backend/document_processor.py
- backend/enterprise_manager.py
- backend/export_manager.py
- backend/growth_manager.py
- backend/llm_client.py
- backend/localization_manager.py
- backend/main.py
- backend/neo4j_manager.py
- backend/ops_manager.py
- backend/performance_manager.py
- backend/plugin_manager.py
- backend/search_manager.py
- backend/security_manager.py
- backend/subscription_manager.py
- backend/tenant_manager.py
- backend/test_phase8_task6.py
- backend/test_phase8_task8.py
- backend/tingwu_client.py
- backend/workflow_manager.py
This commit is contained in:
AutoFix Bot
2026-03-04 03:19:02 +08:00
parent e108f83cd9
commit 0869fec587
20 changed files with 222 additions and 115 deletions

View File

@@ -1108,7 +1108,8 @@ class SubscriptionManager:
cursor.execute(
"""
INSERT INTO usage_records
(id, tenant_id, resource_type, quantity, unit, recorded_at, cost, description, metadata)
(id, tenant_id, resource_type, quantity, unit, recorded_at,
cost, description, metadata)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
""",
(
@@ -1780,7 +1781,9 @@ class SubscriptionManager:
cursor.execute(
"""
UPDATE refunds
SET status = 'rejected', metadata = json_set(metadata, '$.rejection_reason', ?), updated_at = ?
SET status = 'rejected',
metadata = json_set(metadata, '$.rejection_reason', ?),
updated_at = ?
WHERE id = ?
""",
(reason, now, refund_id),
@@ -1860,7 +1863,8 @@ class SubscriptionManager:
cursor.execute(
"""
INSERT INTO billing_history
(id, tenant_id, type, amount, currency, description, reference_id, balance_after, created_at, metadata)
(id, tenant_id, type, amount, currency, description,
reference_id, balance_after, created_at, metadata)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""",
(
@@ -1943,7 +1947,8 @@ class SubscriptionManager:
amount = plan.price_yearly if billing_cycle == "yearly" else plan.price_monthly
return {
"order_id": f"ALI{datetime.now().strftime('%Y%m%d%H%M%S')}{uuid.uuid4().hex[:8].upper()}",
"order_id": f"ALI{datetime.now().strftime('%Y%m%d%H%M%S')}"
f"{uuid.uuid4().hex[:8].upper()}",
"amount": amount,
"currency": plan.currency,
"qr_code_url": f"https://qr.alipay.com/mock/{uuid.uuid4().hex[:16]}",
@@ -1963,7 +1968,8 @@ class SubscriptionManager:
amount = plan.price_yearly if billing_cycle == "yearly" else plan.price_monthly
return {
"order_id": f"WX{datetime.now().strftime('%Y%m%d%H%M%S')}{uuid.uuid4().hex[:8].upper()}",
"order_id": f"WX{datetime.now().strftime('%Y%m%d%H%M%S')}"
f"{uuid.uuid4().hex[:8].upper()}",
"amount": amount,
"currency": plan.currency,
"prepay_id": f"wx{uuid.uuid4().hex[:32]}",