| 21277 |
ashik.ali |
1 |
package com.spice.profitmandi.web.controller;
|
|
|
2 |
|
|
|
3 |
import javax.servlet.http.HttpServletRequest;
|
|
|
4 |
|
|
|
5 |
import org.slf4j.Logger;
|
|
|
6 |
import org.slf4j.LoggerFactory;
|
| 21278 |
ashik.ali |
7 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 21277 |
ashik.ali |
8 |
import org.springframework.http.ResponseEntity;
|
|
|
9 |
import org.springframework.stereotype.Controller;
|
| 21702 |
ashik.ali |
10 |
import org.springframework.transaction.annotation.Transactional;
|
| 21277 |
ashik.ali |
11 |
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
12 |
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
13 |
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
14 |
|
|
|
15 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 21740 |
ashik.ali |
16 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 21735 |
ashik.ali |
17 |
import com.spice.profitmandi.dao.repository.logistics.PostOfficeRepository;
|
| 21277 |
ashik.ali |
18 |
|
|
|
19 |
@Controller
|
| 22037 |
amit.gupta |
20 |
@Transactional(rollbackFor=Throwable.class)
|
| 21277 |
ashik.ali |
21 |
public class PostOfficeController {
|
|
|
22 |
|
| 21448 |
ashik.ali |
23 |
@Autowired
|
| 22931 |
ashik.ali |
24 |
private ResponseSender<?> responseSender;
|
| 21448 |
ashik.ali |
25 |
|
| 21277 |
ashik.ali |
26 |
private static final Logger LOGGER=LoggerFactory.getLogger(PostOfficeController.class);
|
|
|
27 |
|
| 21278 |
ashik.ali |
28 |
@Autowired
|
| 22931 |
ashik.ali |
29 |
private PostOfficeRepository postOfficeRepository;
|
| 21277 |
ashik.ali |
30 |
|
|
|
31 |
@RequestMapping(value = ProfitMandiConstants.URL_POST_OFFICE, method=RequestMethod.GET)
|
| 22880 |
ashik.ali |
32 |
public ResponseEntity<?> getByPin(HttpServletRequest request, @RequestParam(name = "pinCode") int pinCode){
|
| 21277 |
ashik.ali |
33 |
LOGGER.info("requested url : "+request.getRequestURL().toString());
|
| 21448 |
ashik.ali |
34 |
return responseSender.ok(postOfficeRepository.selectByPinCode(pinCode));
|
| 21426 |
ashik.ali |
35 |
|
| 21277 |
ashik.ali |
36 |
}
|
|
|
37 |
}
|