nex_basse/backend/app/models/hotword.py

17 lines
719 B
Python
Raw Normal View History

2026-03-02 10:26:22 +00:00
from sqlalchemy import Column, Integer, String, Float, ForeignKey
from sqlalchemy.orm import relationship
from app.models.base import Base, MYSQL_TABLE_ARGS
2026-02-27 07:57:22 +00:00
class Hotword(Base):
__tablename__ = "biz_hotword"
2026-03-02 10:26:22 +00:00
__table_args__ = MYSQL_TABLE_ARGS
2026-02-27 07:57:22 +00:00
id = Column(Integer, primary_key=True, index=True)
word = Column(String(255), nullable=False, comment="热词")
pinyin = Column(String(255), nullable=True, comment="拼音")
weight = Column(Float, default=1.0, comment="权重")
2026-03-02 10:26:22 +00:00
scope = Column(String(50), default="personal", comment="作用域: personal/public")
user_id = Column(Integer, ForeignKey("sys_user.user_id"), nullable=True, comment="创建人")
creator = relationship("User")