| 36321 |
vikas |
1 |
package com.spice.profitmandi.web.v2.controller;
|
|
|
2 |
|
|
|
3 |
import com.spice.profitmandi.web.controller.ShopController;
|
|
|
4 |
import com.spice.profitmandi.web.v2.response.ApiResponse;
|
|
|
5 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
6 |
import org.springframework.http.ResponseEntity;
|
|
|
7 |
import org.springframework.web.bind.annotation.*;
|
|
|
8 |
|
|
|
9 |
import javax.servlet.http.HttpServletRequest;
|
|
|
10 |
|
|
|
11 |
@RestController
|
|
|
12 |
@RequestMapping("/v2")
|
|
|
13 |
public class V2ShopController extends V2BaseController {
|
|
|
14 |
|
|
|
15 |
@Autowired
|
|
|
16 |
private ShopController shopController;
|
|
|
17 |
|
|
|
18 |
@PostMapping("/shop")
|
|
|
19 |
public ResponseEntity<ApiResponse<?>> createShop(HttpServletRequest request) throws Throwable {
|
|
|
20 |
return wrapResponse(shopController.createShop(request));
|
|
|
21 |
}
|
|
|
22 |
|
|
|
23 |
@GetMapping("/shop/id")
|
|
|
24 |
public ResponseEntity<ApiResponse<?>> getById(HttpServletRequest request,
|
|
|
25 |
@RequestParam(name = "id") int id) throws Throwable {
|
|
|
26 |
return wrapResponse(shopController.getById(request, id));
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
@DeleteMapping("/shop/id")
|
|
|
30 |
public ResponseEntity<ApiResponse<?>> removeById(HttpServletRequest request,
|
|
|
31 |
@RequestParam(name = "id") int id) throws Throwable {
|
|
|
32 |
return wrapResponse(shopController.removeById(request, id));
|
|
|
33 |
}
|
|
|
34 |
}
|