Skip to content
Snippets Groups Projects
Commit 6f23ba01 authored by Martin Gargalovič's avatar Martin Gargalovič
Browse files

implemented get Enrolled and get Finished

parent 7fd55099
No related branches found
No related tags found
3 merge requests!31M2,!28M2 user,!27Draft: M2 user
Pipeline #
......@@ -3,10 +3,13 @@ package org.fuseri.modulelanguageschool.user;
import org.fuseri.modulelanguageschool.common.DomainService;
import jakarta.persistence.EntityNotFoundException;
import lombok.Getter;
import org.fuseri.modulelanguageschool.course.Course;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class UserService extends DomainService<User> {
......@@ -24,4 +27,11 @@ public class UserService extends DomainService<User> {
.orElseThrow(() -> new EntityNotFoundException("User '" + id + "' not found."));
}
public List<Course> getEnrolled(Long id) {
return repository.getEnrolled(id);
}
public List<Course> getFinished(Long id) {
return repository.getFinished(id);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment