# This file is auto-generated by generate_models.py
# This file may be manually edited after generation
# The file has been formatted using isort and black

from typing import Any, ClassVar, Dict, List

from sqlalchemy import Column, PrimaryKeyConstraint, text

from tushare_models.core import Base, Date, DateTime, Float, Integer, String
from tushare_models.core.dialect_config import apply_table_dialect_options


class ThsHot(Base):
    """同花顺App热榜数"""

    __tablename__: str = "ths_hot"
    __api_id__: ClassVar[int] = 320
    __api_name__: ClassVar[str] = "ths_hot"
    __api_title__: ClassVar[str] = "同花顺App热榜数"
    __api_info_title__: ClassVar[str] = "同花顺App热榜数"
    __api_path__: ClassVar[List[str]] = ["数据接口", "股票数据", "打板专题数据"]
    __api_path_ids__: ClassVar[List[int]] = [1, 2, 10]
    __api_points_required__: ClassVar[int] = 0
    __api_special_permission__: ClassVar[bool] = False
    __has_vip__: ClassVar[bool] = False
    __dependencies__: ClassVar[List[str]] = ["trade_cal", "ths_index"]
    __primary_key__: ClassVar[List[str]] = ["ts_code", "trade_date"]
    __start_date__: ClassVar[str | None] = None
    __end_date__: ClassVar[str | None] = None
    __api_params__: ClassVar[Dict[str, Any]] = {
        "trade_date": {"type": "String", "required": False, "description": "交易日期(格式：YYYYMMDD，下同)"},
        "ts_code": {"type": "String", "required": False, "description": "TS代码"},
        "market": {
            "type": "String",
            "required": False,
            "description": "热板类型(热股、ETF、可转债、行业板块、概念板块、期货、港股、热基、美股)",
        },
        "is_new": {"type": "String", "required": False, "description": "是否最新"},
        "limit": {"type": "Int64", "required": False, "description": "单次返回数据长度"},
        "offset": {"type": "Int64", "required": False, "description": "请求数据的开始位移量"},
    }

    __mapper_args__ = {"primary_key": __primary_key__}
    __table_args__ = (
        PrimaryKeyConstraint(*__primary_key__),
        {
            "comment": "同花顺App热榜数",
            # MySQL引擎
            "mysql_engine": "InnoDB",
        },
    )

    trade_date = Column("trade_date", Date, nullable=False, comment="交易日期")
    data_type = Column("data_type", String(), nullable=True, comment="数据类型")
    ts_code = Column("ts_code", String(16), nullable=False, comment="股票代码")
    ts_name = Column("ts_name", String(), nullable=True, comment="股票名称")
    rank = Column("rank", Integer, nullable=True, comment="排行或者热度")
    pct_change = Column("pct_change", Float, nullable=True, comment="涨跌幅%")
    current_price = Column("current_price", Float, nullable=True, comment="当前价格")
    hot = Column("hot", Float, nullable=True, comment="热度")
    concept = Column("concept", String(), nullable=True, comment="标签")
    rank_time = Column("rank_time", String(), nullable=True, comment="排行榜获取时间")
    rank_reason = Column("rank_reason", String(), nullable=True, comment="上榜解读")

apply_table_dialect_options(ThsHot)
