Last change
on this file since 9050790 was 9050790, checked in by Gjoko Kostadinov <gjoko.kostadinov@…>, 16 months ago |
Add admin functionality for activating or deactivating companies
|
-
Property mode
set to
100644
|
File size:
795 bytes
|
Line | |
---|
1 | package edu.gjoko.schedlr.controllers.rest;
|
---|
2 |
|
---|
3 | import edu.gjoko.schedlr.entity.Business;
|
---|
4 | import edu.gjoko.schedlr.services.BusinessService;
|
---|
5 | import lombok.AllArgsConstructor;
|
---|
6 | import org.springframework.web.bind.annotation.*;
|
---|
7 |
|
---|
8 | import java.util.List;
|
---|
9 |
|
---|
10 | @RestController
|
---|
11 | @RequestMapping("api/business")
|
---|
12 | @AllArgsConstructor
|
---|
13 | public class BusinessController {
|
---|
14 |
|
---|
15 | final BusinessService businessService;
|
---|
16 |
|
---|
17 | @PostMapping
|
---|
18 | public void getBusinessTypes(@RequestBody Business business) {
|
---|
19 | businessService.saveBusiness(business);
|
---|
20 | }
|
---|
21 |
|
---|
22 | @GetMapping
|
---|
23 | public List<Business> findAll() {
|
---|
24 | return businessService.findAll();
|
---|
25 | }
|
---|
26 |
|
---|
27 | @PatchMapping
|
---|
28 | public void updateBusinesses(@RequestBody List<Business> businessList) {
|
---|
29 | businessService.updateBusinesses(businessList);
|
---|
30 | }
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.