chore(release): bump version to 1.9.1 and apply pending changes

This commit is contained in:
小鱼开发
2026-06-16 15:17:30 +08:00
parent 9a71584d6c
commit c6a40331d4
152 changed files with 9396 additions and 10267 deletions
+8 -10
View File
@@ -6,6 +6,7 @@
"""
from datetime import datetime, time
from uuid import UUID
from sqlalchemy import func, select
from sqlalchemy.ext.asyncio import AsyncSession
@@ -24,7 +25,7 @@ class PointTransactionCRUD(CRUDBase[PointTransaction]):
self,
db: AsyncSession,
*,
user_id: str,
user_id: UUID | str,
skip: int = 0,
limit: int = 50,
tx_type: str | None = None,
@@ -55,7 +56,7 @@ class PointTransactionCRUD(CRUDBase[PointTransaction]):
self,
db: AsyncSession,
*,
user_id: str,
user_id: UUID | str,
tx_type: str | None = None,
category: str | None = None,
source_type: str | None = None,
@@ -105,18 +106,15 @@ class PointTransactionCRUD(CRUDBase[PointTransaction]):
self,
db: AsyncSession,
*,
user_id: str,
user_id: UUID | str,
) -> int:
"""统计用户今日消费积分总和"""
now = datetime.now()
start_of_day = datetime.combine(now.date(), time.min)
stmt = (
select(func.coalesce(func.sum(PointTransaction.amount), 0))
.where(
PointTransaction.user_id == user_id,
PointTransaction.type == "consume",
PointTransaction.created_at >= start_of_day,
)
stmt = select(func.coalesce(func.sum(PointTransaction.amount), 0)).where(
PointTransaction.user_id == user_id,
PointTransaction.type == "consume",
PointTransaction.created_at >= start_of_day,
)
result = await db.execute(stmt)
return result.scalar() or 0