mirror of
https://github.com/Walter-Sparrow/lunar-tear.git
synced 2026-07-02 05:43:41 +03:00
Add authentication server, dev CLI, Docker multi-service setup, and cross-platform improvements
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
|
||||
pb "lunar-tear/server/gen/proto"
|
||||
"lunar-tear/server/internal/store"
|
||||
"lunar-tear/server/internal/userdata"
|
||||
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
@@ -23,20 +22,18 @@ func NewNotificationServiceServer(users store.UserRepository, sessions store.Ses
|
||||
|
||||
func (s *NotificationServiceServer) GetHeaderNotification(ctx context.Context, req *emptypb.Empty) (*pb.GetHeaderNotificationResponse, error) {
|
||||
log.Printf("[NotificationService] GetHeaderNotification")
|
||||
userId := currentUserId(ctx, s.users, s.sessions)
|
||||
userId := CurrentUserId(ctx, s.users, s.sessions)
|
||||
user, err := s.users.LoadUser(userId)
|
||||
if err != nil {
|
||||
return &pb.GetHeaderNotificationResponse{
|
||||
GiftNotReceiveCount: 0,
|
||||
FriendRequestReceiveCount: 0,
|
||||
IsExistUnreadInformation: false,
|
||||
DiffUserData: userdata.EmptyDiff(),
|
||||
}, nil
|
||||
}
|
||||
return &pb.GetHeaderNotificationResponse{
|
||||
GiftNotReceiveCount: int32(len(user.Gifts.NotReceived)),
|
||||
FriendRequestReceiveCount: user.Notifications.FriendRequestReceiveCount,
|
||||
IsExistUnreadInformation: user.Notifications.IsExistUnreadInformation,
|
||||
DiffUserData: userdata.EmptyDiff(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user