source: phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/OfferReportController.java

Last change on this file was 47f4eaf, checked in by Marko <Marko@…>, 23 months ago

Final features implemented

  • Property mode set to 100644
File size: 1.4 KB
Line 
1package finki.it.phoneluxbackend.controllers;
2
3import finki.it.phoneluxbackend.entities.OfferReport;
4import finki.it.phoneluxbackend.services.OfferReportService;
5import lombok.AllArgsConstructor;
6import org.apache.coyote.Response;
7import org.springframework.http.ResponseEntity;
8import org.springframework.stereotype.Controller;
9import org.springframework.web.bind.annotation.*;
10
11import java.util.List;
12
13@AllArgsConstructor
14@RestController
15@RequestMapping(path = "/offerreport")
16public class OfferReportController {
17 private final OfferReportService offerReportService;
18
19 @GetMapping(path = "/allreports")
20 public List<OfferReport> getAllOfferReports(){
21 return offerReportService.getAllOfferReports();
22 }
23
24 @PostMapping(path = "/{offerId}/{userId}")
25 public ResponseEntity<Object> reportOffer(@PathVariable("offerId") Long offerId,
26 @PathVariable("userId") Long userId){
27
28 return offerReportService.reportOffer(offerId, userId);
29 }
30
31 @DeleteMapping(path = "/remove/{offerReportId}")
32 public ResponseEntity<Object> removeOfferReport(@PathVariable("offerReportId") Long offerReportId){
33
34 return offerReportService.removeOfferReport(offerReportId);
35 }
36
37 @DeleteMapping(path = "/removeall")
38 public ResponseEntity<Object> removeAllOfferReports(){
39
40 return offerReportService.removeAllOfferReports();
41 }
42
43
44
45}
Note: See TracBrowser for help on using the repository browser.