修复一些导入相关错误

This commit is contained in:
stone 2025-08-06 23:43:29 +08:00
parent eedcd4e4da
commit 9976ea9c73
2 changed files with 7 additions and 4 deletions

View File

@ -4,7 +4,10 @@
"""
from peewee import DateTimeField, DecimalField, BigIntegerField
from database_config import BaseModel, get_database
try:
from database_config import BaseModel, get_database
except ImportError:
from .database_config import BaseModel, get_database
import logging
from decimal import Decimal
from datetime import datetime
@ -71,7 +74,7 @@ def create_stock_kline_model(stock_code: str, period: str = "1d"):
'stock_code': stock_code, # 保存原始股票代码
})
logger.info(f"📊 创建股票K线模型: {class_name} -> {table_name}")
logger.debug(f"📊 创建股票K线模型: {class_name} -> {table_name}")
return model_class
def create_tables_for_stocks(stock_codes: list, period: str = "1d"):

View File

@ -10,8 +10,8 @@ import os
# 添加项目根目录到Python路径
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from src.strategy import GridStrategy
from src.network_model.simple_socket_server import SimpleQTradeSocketServerManager
from strategy import GridStrategy
from network_model.simple_socket_server import SimpleQTradeSocketServerManager
# 全局策略实例
strategy = GridStrategy(