Last change
on this file was 53765dd, checked in by gjoko kostadinov <gjokokostadinov@…>, 6 months ago |
Fix bugs.
|
-
Property mode
set to
100755
|
File size:
1.1 KB
|
Rev | Line | |
---|
[a436340] | 1 | package edu.gjoko.schedlr.controllers.rest;
|
---|
| 2 |
|
---|
| 3 | import edu.gjoko.schedlr.entity.BusinessType;
|
---|
[53765dd] | 4 | import edu.gjoko.schedlr.entity.ServiceType;
|
---|
[a436340] | 5 | import edu.gjoko.schedlr.services.NomenclaturesService;
|
---|
| 6 | import lombok.AllArgsConstructor;
|
---|
| 7 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
[53765dd] | 8 | import org.springframework.web.bind.annotation.PathVariable;
|
---|
[a436340] | 9 | import org.springframework.web.bind.annotation.RequestMapping;
|
---|
| 10 | import org.springframework.web.bind.annotation.RestController;
|
---|
| 11 |
|
---|
[53765dd] | 12 | import javax.servlet.http.HttpServletRequest;
|
---|
[a436340] | 13 | import java.util.List;
|
---|
| 14 |
|
---|
| 15 | @RestController
|
---|
[53765dd] | 16 | @RequestMapping("api/nomenclature")
|
---|
[a436340] | 17 | @AllArgsConstructor
|
---|
[77205be] | 18 | public class NomenclatureApi {
|
---|
[a436340] | 19 |
|
---|
| 20 | private final NomenclaturesService nomenclaturesService;
|
---|
| 21 | @GetMapping( "/businessTypes")
|
---|
| 22 | public List<BusinessType> getBusinessTypes() {
|
---|
| 23 | return nomenclaturesService.getBusinessTypes();
|
---|
| 24 | }
|
---|
[53765dd] | 25 |
|
---|
| 26 | @GetMapping( "/serviceTypes/me")
|
---|
| 27 | public List<ServiceType> getServiceTypesForBusinessType( HttpServletRequest request) {
|
---|
| 28 | Long ownerId = (long) request.getSession(true).getAttribute("stakeholderId");
|
---|
| 29 | return nomenclaturesService.findAppropriateBusinessTypesForBusinessByOwnerId(ownerId);
|
---|
| 30 | }
|
---|
[a436340] | 31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.