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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user