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
|
Rev | Line | |
---|
[2e46f06] | 1 | package com.example.autopartz.controller;
|
---|
| 2 |
|
---|
| 3 | import com.example.autopartz.model.RepairShopReviewsSummary;
|
---|
| 4 | import com.example.autopartz.model.User;
|
---|
| 5 | import com.example.autopartz.repository.RepairShopReviewSummaryRepository;
|
---|
| 6 | import com.example.autopartz.service.UserService;
|
---|
| 7 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
| 8 | import org.springframework.web.bind.annotation.RequestMapping;
|
---|
| 9 | import org.springframework.web.bind.annotation.RestController;
|
---|
| 10 |
|
---|
| 11 | import java.util.List;
|
---|
| 12 |
|
---|
| 13 | @RestController
|
---|
| 14 | @RequestMapping("/")
|
---|
| 15 | public 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.