buscar usuario por id
Some checks failed
Deploy Spring Boot App / build-and-deploy (push) Has been cancelled

This commit is contained in:
2025-12-10 16:11:31 -04:00
parent 9abd4cce72
commit cb32994d9b
3 changed files with 16 additions and 1 deletions

View File

@@ -74,5 +74,14 @@ public class UsuarioService {
repo.deleteById(id);
}
//encontrar el usuario por gmail
public Long findId(String username){
Usuario usuario = repo.findByUsername(username)
.orElseThrow(() -> new RuntimeException("Usuario no encontrado: " + username));
return usuario.getId();
}
}