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