```
feat: 添加飞书用户模块和订阅功能支持 - 新增feishu_users模块用于处理飞书用户身份验证和权限管理 - 新增subscriptions模块用于处理订阅相关功能 - 新增personalization模块用于个性化服务 - 在alembic迁移配置中注册新的模型模块 - 在API路由器中添加feishu_users和subscriptions路由 - 实现事件调度服务的改进,包括错误处理和状态更新优化 - 添加飞书命令处理的权限检查机制 - 实现飞书应用票据事件处理 - 改进审计日志记录功能 ```
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
from datetime import date, datetime
|
||||
from decimal import Decimal
|
||||
|
||||
from sqlalchemy import Boolean, Date, DateTime, Integer, Numeric, String, UniqueConstraint
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
from sqlalchemy import (
|
||||
Boolean,
|
||||
Date,
|
||||
DateTime,
|
||||
ForeignKey,
|
||||
Integer,
|
||||
Numeric,
|
||||
String,
|
||||
UniqueConstraint,
|
||||
)
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.core.database import Base
|
||||
from app.modules.feishu_users.models import FeishuUser
|
||||
from app.modules.business.models.common import TimestampMixin
|
||||
|
||||
|
||||
@@ -80,8 +90,16 @@ class MarketAnnouncement(Base, TimestampMixin):
|
||||
|
||||
class MarketWatchlist(Base, TimestampMixin):
|
||||
__tablename__ = "market_watchlists"
|
||||
__table_args__ = (UniqueConstraint("actor", "symbol", name="uq_market_watchlist_actor_symbol"),)
|
||||
__table_args__ = (
|
||||
UniqueConstraint("owner_id", "symbol", name="uq_market_watchlist_owner_symbol"),
|
||||
)
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
||||
owner_id: Mapped[int | None] = mapped_column(
|
||||
ForeignKey("feishu_users.id", ondelete="CASCADE"),
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
owner: Mapped[FeishuUser | None] = relationship()
|
||||
actor: Mapped[str] = mapped_column(String(128), index=True)
|
||||
symbol: Mapped[str] = mapped_column(String(32), index=True)
|
||||
enabled: Mapped[bool] = mapped_column(Boolean, default=True, index=True)
|
||||
|
||||
Reference in New Issue
Block a user