source: src/main/java/it/finki/charitable/services/ReportPostService.java@ 0f4f552

Last change on this file since 0f4f552 was ab49338, checked in by KostaFortumanov <kfortumanov@…>, 3 years ago

Dodadeno prijavuvanje na objavi

  • Property mode set to 100644
File size: 1.0 KB
Line 
1package it.finki.charitable.services;
2
3import it.finki.charitable.entities.DonationPost;
4import it.finki.charitable.entities.Reason;
5import it.finki.charitable.entities.ReportPost;
6import it.finki.charitable.repository.ReportPostRepository;
7import org.springframework.stereotype.Service;
8
9import java.util.List;
10
11@Service
12public class ReportPostService {
13
14 private final ReportPostRepository reportPostRepository;
15
16 public ReportPostService(ReportPostRepository reportPostRepository) {
17 this.reportPostRepository = reportPostRepository;
18 }
19
20 public List<ReportPost> findAll() {
21 return reportPostRepository.findAll();
22 }
23
24 public ReportPost findById(Long id) {
25 return reportPostRepository.getById(id);
26 }
27
28 public ReportPost findByDonationPost(DonationPost post) {
29 return reportPostRepository.findByDonationPost(post);
30 }
31
32 public void save(ReportPost post) {
33 reportPostRepository.save(post);
34 }
35
36 public void delete(ReportPost reportPost) {
37 reportPostRepository.delete(reportPost);
38 }
39}
Note: See TracBrowser for help on using the repository browser.