source: src/main/java/project/educatum/service/impl/InterestServiceImpl.java

Last change on this file was d3cf3a1, checked in by Marija Micevska <marija_micevska@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 869 bytes
Line 
1package project.educatum.service.impl;
2
3import org.springframework.stereotype.Service;
4import project.educatum.model.Interest;
5import project.educatum.model.primarykeys.InterestID;
6import project.educatum.repository.InterestRepository;
7import project.educatum.service.InterestService;
8
9import java.time.LocalDate;
10
11@Service
12public class InterestServiceImpl implements InterestService {
13
14 private final InterestRepository interestRepository;
15
16 public InterestServiceImpl(InterestRepository interestRepository) {
17 this.interestRepository = interestRepository;
18 }
19
20 @Override
21 public void addSubjectStudent(Integer subjectID, Integer studentID, LocalDate datum) {
22 InterestID interestID = new InterestID(subjectID, studentID);
23 Interest interested = new Interest(interestID, datum);
24 interestRepository.save(interested);
25 }
26}
Note: See TracBrowser for help on using the repository browser.