| 36321 |
vikas |
1 |
package com.spice.profitmandi.web.v2.controller;
|
|
|
2 |
|
|
|
3 |
import com.spice.profitmandi.web.controller.BrandController;
|
|
|
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 V2BrandController extends V2BaseController {
|
|
|
14 |
|
|
|
15 |
@Autowired
|
|
|
16 |
private BrandController brandController;
|
|
|
17 |
|
|
|
18 |
@GetMapping("/brand/all")
|
|
|
19 |
public ResponseEntity<ApiResponse<?>> getAll(HttpServletRequest request,
|
|
|
20 |
@RequestParam(name = "pageNumber") int pageNumber,
|
|
|
21 |
@RequestParam(name = "pageSize") int pageSize) throws Throwable {
|
|
|
22 |
return wrapResponse(brandController.getAll(request, pageNumber, pageSize));
|
|
|
23 |
}
|
|
|
24 |
|
|
|
25 |
@GetMapping("/brand/id")
|
|
|
26 |
public ResponseEntity<ApiResponse<?>> getById(HttpServletRequest request,
|
|
|
27 |
@RequestParam(name = "id") int id) throws Throwable {
|
|
|
28 |
return wrapResponse(brandController.getById(request, id));
|
|
|
29 |
}
|
|
|
30 |
}
|