make a media api, encapsulate the original S3 bucket address

there are 3 parts, from back to head, url inside the bucket -> url of backend media api -> backend domain, only the last part is spliced by frontend, the other two parts are spliced with sqlalchemy
This commit is contained in:
2026-05-20 17:31:49 +08:00
parent d2162f93e0
commit 61e3d71b72
4 changed files with 65 additions and 1 deletions
+5 -1
View File
@@ -4,15 +4,19 @@ from datetime import datetime
from strawberry.types import Info
from app.utils.format import get_image_url
from app.models.user import User
@strawberry.type
class UserType:
id: str
email: str
name: str
avatar: str
handle: Optional[str]
@strawberry.field
def avatar(self, root: User) -> Optional[str]:
return root.avatar_url
# 互动统计字段
following_count: int
follower_count: int