| 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;
|
|
|
10 |
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
11 |
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
12 |
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
13 |
|
|
|
14 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
|
|
15 |
import com.spice.profitmandi.dao.repository.PostOfficeRepository;
|
| 21448 |
ashik.ali |
16 |
import com.spice.profitmandi.web.util.ResponseSender;
|
| 21277 |
ashik.ali |
17 |
|
|
|
18 |
@Controller
|
|
|
19 |
public class PostOfficeController {
|
|
|
20 |
|
| 21448 |
ashik.ali |
21 |
@Autowired
|
|
|
22 |
ResponseSender<?> responseSender;
|
|
|
23 |
|
| 21277 |
ashik.ali |
24 |
private static final Logger LOGGER=LoggerFactory.getLogger(PostOfficeController.class);
|
|
|
25 |
|
| 21278 |
ashik.ali |
26 |
@Autowired
|
|
|
27 |
PostOfficeRepository postOfficeRepository;
|
| 21277 |
ashik.ali |
28 |
|
|
|
29 |
@RequestMapping(value = ProfitMandiConstants.URL_POST_OFFICE, method=RequestMethod.GET)
|
|
|
30 |
public ResponseEntity<?> getByPin(HttpServletRequest request, @RequestParam(name = "pinCode") long pinCode){
|
|
|
31 |
LOGGER.info("requested url : "+request.getRequestURL().toString());
|
| 21448 |
ashik.ali |
32 |
return responseSender.ok(postOfficeRepository.selectByPinCode(pinCode));
|
| 21426 |
ashik.ali |
33 |
|
| 21277 |
ashik.ali |
34 |
}
|
|
|
35 |
}
|