from pydantic import BaseModel from typing import Optional class StockQuote(BaseModel): code: str market: str name: str todayOpen: float yesterdayClose: float currentPrice: float high: float low: float volume: float amount: float outerDisk: float innerDisk: float date: str time: str change: float changePercent: float class KLineData(BaseModel): date: str open: float close: float high: float low: float volume: float class StockSearchResult(BaseModel): code: str name: str market: str type: str class FundFlowData(BaseModel): date: str mainNetInflow: float superLargeInflow: float superLargeOutflow: float largeInflow: float largeOutflow: float mediumInflow: float mediumOutflow: float smallInflow: float smallOutflow: float mainNetInflowPercent: float superLargeInflowPercent: float superLargeOutflowPercent: float largeInflowPercent: float largeOutflowPercent: float mediumInflowPercent: float mediumOutflowPercent: float smallInflowPercent: float smallOutflowPercent: float turnover: float mainForceNet: float retailNet: float cumulativeMainNet: float cumulativeRetailNet: float changePercent: float closePrice: float class FundFlowSummary(BaseModel): totalMainNet: float totalTurnover: float totalLargeInflow: Optional[float] = 0 avgDailyMainNet: float positiveDays: int negativeDays: int class StockCollection(BaseModel): id: int name: str description: Optional[str] = None user_id: str last_accessed_at: str created_at: str updated_at: str class StockCollectionCreate(BaseModel): name: str description: Optional[str] = None user_id: str class StockCollectionUpdate(BaseModel): name: Optional[str] = None description: Optional[str] = None user_id: Optional[str] = None last_accessed_at: Optional[str] = None class CollectionStock(BaseModel): id: int collection_id: int stock_code: str stock_name: str added_price: Optional[float] = None added_at: str class CollectionStockCreate(BaseModel): stock_code: str stock_name: str added_price: Optional[float] = None class ShareLink(BaseModel): id: int collection_id: int short_code: str created_at: str expires_at: Optional[str] = None class CompanyProfile(BaseModel): """公司概况""" code: str name: str fullName: str englishName: str boardType: str industry: str exchange: str industryDetail: str chairman: str generalManager: str secretary: str phone: str email: str fax: str website: str officeAddress: str registeredAddress: str region: str postalCode: str registeredCapital: str unifiedCreditCode: str employees: str managementCount: str lawFirm: str auditor: str businessScope: str companyProfile: str establishmentDate: str listingDate: str listingPrice: str issuePriceEarningsRatio: str issueAmount: str netProceeds: str issueMethod: str class FinancialReportItem(BaseModel): """单期财务报告""" reportDate: str reportType: str reportDateName: str noticeDate: str indicators: dict class FinancialDataResponse(BaseModel): """财务数据响应""" code: str name: str count: int data: list[FinancialReportItem]