from abc import ABC, abstractmethod
from typing import List, Optional
from src.jixia.models.financial_data_models import StockQuote, HistoricalPrice, CompanyProfile, FinancialNews

class DataProvider(ABC):
    """金融数据提供商抽象基类"""
    
    @abstractmethod
    def get_quote(self, symbol: str) -> Optional[StockQuote]:
        """获取股票报价"""
        pass
    
    @abstractmethod
    def get_historical_prices(self, symbol: str, days: int = 30) -> List[HistoricalPrice]:
        """获取历史价格数据"""
        pass
    
    @abstractmethod
    def get_company_profile(self, symbol: str) -> Optional[CompanyProfile]:
        """获取公司概况"""
        pass
    
    @abstractmethod
    def get_news(self, symbol: str, limit: int = 10) -> List[FinancialNews]:
        """获取相关新闻"""
        pass

    @property
    @abstractmethod
    def name(self) -> str:
        """数据提供商名称"""
        pass

    @property
    @abstractmethod
    def priority(self) -> int:
        """优先级（数字越小优先级越高）"""
        pass