source: src/main/java/com/example/autopartz/controller/UserController.java@ 2e46f06

main
Last change on this file since 2e46f06 was 2e46f06, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 19 months ago

Adding the models and testing one view

  • Property mode set to 100644
File size: 1.1 KB
Line 
1package com.example.autopartz.controller;
2
3import com.example.autopartz.model.RepairShopReviewsSummary;
4import com.example.autopartz.model.User;
5import com.example.autopartz.repository.RepairShopReviewSummaryRepository;
6import com.example.autopartz.service.UserService;
7import org.springframework.web.bind.annotation.GetMapping;
8import org.springframework.web.bind.annotation.RequestMapping;
9import org.springframework.web.bind.annotation.RestController;
10
11import java.util.List;
12
13@RestController
14@RequestMapping("/")
15public class UserController {
16 private final UserService userService;
17 private final RepairShopReviewSummaryRepository rspsr;
18
19 public UserController(UserService userService, RepairShopReviewSummaryRepository rspsr) {
20 this.userService = userService;
21 this.rspsr = rspsr;
22 }
23 @GetMapping("reportTest")
24 public List<RepairShopReviewsSummary> getRepairShopReport(){
25 return rspsr.findAllByRsid(2L);
26 }
27 @GetMapping("usersTest")
28 public List<User> getAllUsers(){
29 return userService.findAllUsers();
30 }
31}
Note: See TracBrowser for help on using the repository browser.