spark-server/internal/module/friend/logic/friends.go
zhr ae9a71034d feat: implement Spark IM V3 modular monolith
Add HTTP /v1 MVC, TCP send path, groups with server-side member-avatar collage, object-storage upload, and friends/favorites around the architecture-v3 layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 19:52:11 +08:00

23 lines
394 B
Go

package logic
import (
"context"
"errors"
"spark-server/internal/pkg/errs"
)
func (s *Service) AreFriends(ctx context.Context, a, b int64) (bool, error) {
if !s.ready() || a <= 0 || b <= 0 || a == b {
return false, nil
}
_, err := s.repo.GetRelation(ctx, a, b)
if err == nil {
return true, nil
}
if errors.Is(err, errs.ErrNotFound) {
return false, nil
}
return false, err
}