You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
901 B
33 lines
901 B
|
2 months ago
|
#!/usr/bin/env python3
|
||
|
|
"""amazingData 简单测试"""
|
||
|
|
import sys
|
||
|
|
sys.path.insert(0, '/app/working/workspaces/developer/projects/20260330_kline_system/backend')
|
||
|
|
|
||
|
|
from app.services.amazing_data_adapter import AmazingDataAdapter, DataSourceConfig, SecurityType, Period
|
||
|
|
|
||
|
|
config = DataSourceConfig(
|
||
|
|
username='11200008169',
|
||
|
|
password='11200008169@2026',
|
||
|
|
host='140.206.44.234',
|
||
|
|
port=8600
|
||
|
|
)
|
||
|
|
|
||
|
|
adapter = AmazingDataAdapter(config)
|
||
|
|
print("Connecting...")
|
||
|
|
if adapter.connect():
|
||
|
|
print("✅ Connected!")
|
||
|
|
|
||
|
|
# 测试获取代码列表
|
||
|
|
print("\nGetting stock codes...")
|
||
|
|
codes = adapter.get_code_list(SecurityType.STOCK_A)
|
||
|
|
print(f"Total codes: {len(codes) if codes else 0}")
|
||
|
|
if codes:
|
||
|
|
print(f"Sample: {codes[:5]}")
|
||
|
|
|
||
|
|
# 测试 600126
|
||
|
|
print("\nDisconnecting...")
|
||
|
|
adapter.disconnect()
|
||
|
|
print("✅ Disconnected!")
|
||
|
|
else:
|
||
|
|
print("❌ Connection failed")
|