business: add privacy-aware user projection

(cherry picked from commit a636192ef22ee69d792b0ca7db1c6be963be9cb2)
This commit is contained in:
A 2026-06-08 01:07:21 +08:00
parent 14d220c971
commit 8ff3343ae0
29 changed files with 2239 additions and 112 deletions

View file

@ -21,10 +21,11 @@ type User struct {
Support bool
Contact bool
Mutual bool
// Profile photo:反范式存于 users 表,便于无 join 渲染头像。PhotoID==0 表示无头像。
// Profile photo fields are filled by app-layer user projection. PhotoID==0 表示无头像。
PhotoID int64
PhotoDCID int
PhotoStripped []byte
PhotoPersonal bool
LastSeenAt int
Status UserStatus
}
@ -61,3 +62,17 @@ type UserProfileUpdate struct {
About string
HasAbout bool
}
// UserFullView is the app-layer personalized full user view consumed by RPC.
type UserFullView struct {
User User
ProfilePhoto *Photo
PersonalPhoto *Photo
FallbackPhoto *Photo
About string
PhoneCallsAvailable bool
PhoneCallsPrivate bool
VideoCallsAvailable bool
VoiceMessagesForbidden bool
ReadDatesPrivate bool
}