fix: 修复了自己关注自己的bug

This commit is contained in:
Leon
2025-12-23 02:26:53 +08:00
parent a98e9d28f0
commit a6b649e986

View File

@@ -24,6 +24,9 @@ func (s *SocialService) Follow(ctx context.Context, social *Social) error {
if err != nil {
return err
}
if social.FollowerID == social.VloggerID {
return errors.New("can not follow self")
}
isFollowed, err := s.repo.IsFollowed(ctx, social)
if err != nil {
return err