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>
23 lines
394 B
Go
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
|
|
}
|