fix(relationship): add target in response

This commit is contained in:
MingxuanGame
2025-07-28 15:19:56 +00:00
parent e1b1d98c7a
commit 0cba7e9dd2
5 changed files with 45 additions and 15 deletions

View File

@@ -102,8 +102,8 @@ class User(SQLModel, table=True):
)
@classmethod
def all_select_clause(cls):
return select(cls).options(
def all_select_option(cls):
return (
joinedload(cls.lazer_profile), # pyright: ignore[reportArgumentType]
joinedload(cls.lazer_counts), # pyright: ignore[reportArgumentType]
joinedload(cls.daily_challenge_stats), # pyright: ignore[reportArgumentType]
@@ -121,6 +121,10 @@ class User(SQLModel, table=True):
selectinload(cls.lazer_replays_watched), # pyright: ignore[reportArgumentType]
)
@classmethod
def all_select_clause(cls):
return select(cls).options(*cls.all_select_option())
# ============================================
# Lazer API 专用表模型