Subversion Repositories SmartDukaan

Rev

Rev 23047 | Rev 23494 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23047 Rev 23330
Line 5... Line 5...
5
import javax.servlet.http.HttpServletRequest;
5
import javax.servlet.http.HttpServletRequest;
6
 
6
 
7
import org.slf4j.Logger;
7
import org.slf4j.Logger;
8
import org.slf4j.LoggerFactory;
8
import org.slf4j.LoggerFactory;
9
import org.springframework.beans.factory.annotation.Autowired;
9
import org.springframework.beans.factory.annotation.Autowired;
-
 
10
import org.springframework.http.ResponseEntity;
10
import org.springframework.stereotype.Controller;
11
import org.springframework.stereotype.Controller;
11
import org.springframework.transaction.annotation.Transactional;
12
import org.springframework.transaction.annotation.Transactional;
12
import org.springframework.ui.Model;
13
import org.springframework.ui.Model;
13
import org.springframework.web.bind.annotation.RequestBody;
14
import org.springframework.web.bind.annotation.RequestBody;
14
import org.springframework.web.bind.annotation.RequestMapping;
15
import org.springframework.web.bind.annotation.RequestMapping;
Line 16... Line 17...
16
import org.springframework.web.bind.annotation.RequestParam;
17
import org.springframework.web.bind.annotation.RequestParam;
17
 
18
 
18
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
19
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
19
import com.spice.profitmandi.common.model.ProfitMandiConstants;
20
import com.spice.profitmandi.common.model.ProfitMandiConstants;
20
import com.spice.profitmandi.common.model.UpdateRetailerRequest;
21
import com.spice.profitmandi.common.model.UpdateRetailerRequest;
-
 
22
import com.spice.profitmandi.common.web.util.ResponseSender;
21
import com.spice.profitmandi.service.user.RetailerService;
23
import com.spice.profitmandi.service.user.RetailerService;
22
 
24
 
23
@Controller
25
@Controller
24
@Transactional(rollbackFor=Throwable.class)
26
@Transactional(rollbackFor=Throwable.class)
25
public class RetailerController {
27
public class RetailerController {
Line 27... Line 29...
27
	private static final Logger LOGGER = LoggerFactory.getLogger(RetailerController.class);
29
	private static final Logger LOGGER = LoggerFactory.getLogger(RetailerController.class);
28
	
30
	
29
	@Autowired
31
	@Autowired
30
	private RetailerService retailerService;
32
	private RetailerService retailerService;
31
	
33
	
-
 
34
	@Autowired
-
 
35
	private ResponseSender<?> responseSender;
-
 
36
	
32
	@RequestMapping(value = "/retailerDetail", method = RequestMethod.GET)
37
	@RequestMapping(value = "/retailerDetail", method = RequestMethod.GET)
33
	public String retailerInfoByEmailIdOrMobileNumber(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber, Model model)  throws ProfitMandiBusinessException{
38
	public String retailerInfoByEmailIdOrMobileNumber(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber, Model model)  throws ProfitMandiBusinessException{
34
		LOGGER.info("Request Received at url {} with emailIdOrMobileNumber {}", request.getRequestURI(), emailIdOrMobileNumber);
39
		LOGGER.info("Request Received at url {} with emailIdOrMobileNumber {}", request.getRequestURI(), emailIdOrMobileNumber);
35
		Map<String, Object> map = retailerService.getByEmailIdOrMobileNumber(emailIdOrMobileNumber);
40
		Map<String, Object> map = retailerService.getByEmailIdOrMobileNumber(emailIdOrMobileNumber);
36
		model.addAllAttributes(map);
41
		model.addAllAttributes(map);
Line 48... Line 53...
48
 
53
 
49
	@RequestMapping(value = "/retailerInfo", method = RequestMethod.GET)
54
	@RequestMapping(value = "/retailerInfo", method = RequestMethod.GET)
50
	public String retailerInfo(HttpServletRequest request)  throws Exception{
55
	public String retailerInfo(HttpServletRequest request)  throws Exception{
51
		return "retailer-info";
56
		return "retailer-info";
52
	}
57
	}
-
 
58
	
-
 
59
	@RequestMapping(value = "/district/all/stateName", method = RequestMethod.GET)
-
 
60
	public ResponseEntity<?> getAllDistrict(@RequestParam(name = "stateName") String stateName){
-
 
61
		return responseSender.ok(retailerService.getAllDistrictMaster(stateName));
-
 
62
	}
53
}
63
}
54
64