| Line 8... |
Line 8... |
| 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.stereotype.Controller;
|
10 |
import org.springframework.stereotype.Controller;
|
| 11 |
import org.springframework.transaction.annotation.Transactional;
|
11 |
import org.springframework.transaction.annotation.Transactional;
|
| 12 |
import org.springframework.ui.Model;
|
12 |
import org.springframework.ui.Model;
|
| - |
|
13 |
import org.springframework.web.bind.annotation.RequestBody;
|
| 13 |
import org.springframework.web.bind.annotation.RequestMapping;
|
14 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 14 |
import org.springframework.web.bind.annotation.RequestMethod;
|
15 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 15 |
import org.springframework.web.bind.annotation.RequestParam;
|
16 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 16 |
|
17 |
|
| 17 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
18 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 18 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
19 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| - |
|
20 |
import com.spice.profitmandi.common.model.UpdateRetailerRequest;
|
| 19 |
import com.spice.profitmandi.service.user.RetailerService;
|
21 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 20 |
|
22 |
|
| 21 |
@Controller
|
23 |
@Controller
|
| 22 |
@Transactional(rollbackFor=Throwable.class)
|
24 |
@Transactional(rollbackFor=Throwable.class)
|
| 23 |
public class RetailerController {
|
25 |
public class RetailerController {
|
| Line 41... |
Line 43... |
| 41 |
Map<String, Object> map = retailerService.updateRetailerDocument(emailIdOrMobileNumber, documentId);
|
43 |
Map<String, Object> map = retailerService.updateRetailerDocument(emailIdOrMobileNumber, documentId);
|
| 42 |
model.addAllAttributes(map);
|
44 |
model.addAllAttributes(map);
|
| 43 |
return "retailer-details";
|
45 |
return "retailer-details";
|
| 44 |
}
|
46 |
}
|
| 45 |
|
47 |
|
| - |
|
48 |
@RequestMapping(value = "/retailerDetails", method = RequestMethod.PUT)
|
| - |
|
49 |
public String updateRetailerDetails(HttpServletRequest request, @RequestBody UpdateRetailerRequest updateRetailerRequest, Model model) throws ProfitMandiBusinessException{
|
| - |
|
50 |
LOGGER.info("Request Received at url {} with body {}", request.getRequestURI(), updateRetailerRequest);
|
| - |
|
51 |
Map<String, Object> map = retailerService.updateRetailerDetails(updateRetailerRequest);
|
| - |
|
52 |
model.addAllAttributes(map);
|
| - |
|
53 |
return "retailer-details";
|
| - |
|
54 |
}
|
| - |
|
55 |
|
| 46 |
@RequestMapping(value = "/updateRetailerShopDocument", method = RequestMethod.PUT)
|
56 |
@RequestMapping(value = "/updateRetailerShopDocument", method = RequestMethod.PUT)
|
| 47 |
public String updateRetailerShopDocument(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber, @RequestParam(name = ProfitMandiConstants.SHOP_ID) int shopId, @RequestParam(name = ProfitMandiConstants.DOCUMENT_ID) int documentId, Model model) throws ProfitMandiBusinessException{
|
57 |
public String updateRetailerShopDocument(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber, @RequestParam(name = ProfitMandiConstants.SHOP_ID) int shopId, @RequestParam(name = ProfitMandiConstants.DOCUMENT_ID) int documentId, Model model) throws ProfitMandiBusinessException{
|
| 48 |
LOGGER.info("Request Received at url {} with documentId {}", request.getRequestURI(), documentId);
|
58 |
LOGGER.info("Request Received at url {} with documentId {}", request.getRequestURI(), documentId);
|
| 49 |
Map<String, Object> map = retailerService.updateRetailerShopDocument(emailIdOrMobileNumber, shopId, documentId);
|
59 |
Map<String, Object> map = retailerService.updateRetailerShopDocument(emailIdOrMobileNumber, shopId, documentId);
|
| 50 |
model.addAllAttributes(map);
|
60 |
model.addAllAttributes(map);
|
| 51 |
return "retailer-details";
|
61 |
return "retailer-details";
|
| 52 |
}
|
62 |
}
|
| - |
|
63 |
|
| 53 |
|
64 |
|
| 54 |
@RequestMapping(value = "/retailerInfo", method = RequestMethod.GET)
|
65 |
@RequestMapping(value = "/retailerInfo", method = RequestMethod.GET)
|
| 55 |
public String retailerInfo(HttpServletRequest request) throws Exception{
|
66 |
public String retailerInfo(HttpServletRequest request) throws Exception{
|
| 56 |
return "retailer-info";
|
67 |
return "retailer-info";
|
| 57 |
}
|
68 |
}
|