Subversion Repositories SmartDukaan

Rev

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

Rev 21292 Rev 21302
Line 12... Line 12...
12
import org.springframework.http.ResponseEntity;
12
import org.springframework.http.ResponseEntity;
13
import org.springframework.stereotype.Controller;
13
import org.springframework.stereotype.Controller;
14
import org.springframework.web.bind.annotation.RequestMapping;
14
import org.springframework.web.bind.annotation.RequestMapping;
15
import org.springframework.web.bind.annotation.RequestMethod;
15
import org.springframework.web.bind.annotation.RequestMethod;
16
import org.springframework.web.bind.annotation.RequestParam;
16
import org.springframework.web.bind.annotation.RequestParam;
17
import org.springframework.web.multipart.MultipartFile;
-
 
18
 
17
 
19
import com.spice.profitmandi.common.ResponseCodeHolder;
18
import com.spice.profitmandi.common.ResponseCodeHolder;
20
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
19
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
21
import com.spice.profitmandi.common.model.ProfitMandiConstants;
20
import com.spice.profitmandi.common.model.ProfitMandiConstants;
22
import com.spice.profitmandi.dao.entity.Retailer;
21
import com.spice.profitmandi.dao.entity.Retailer;
Line 37... Line 36...
37
	
36
	
38
	@Autowired
37
	@Autowired
39
	RetailerRepository retailerRepository;
38
	RetailerRepository retailerRepository;
40
	
39
	
41
	@RequestMapping(value = ProfitMandiConstants.URL_SHOP, method=RequestMethod.POST)
40
	@RequestMapping(value = ProfitMandiConstants.URL_SHOP, method=RequestMethod.POST)
42
	public ResponseEntity<?> createShop(@RequestParam("document") final MultipartFile multipartFile, HttpServletRequest request){
41
	public ResponseEntity<?> createShop(HttpServletRequest request){
43
		LOGGER.info("requested url : "+request.getRequestURL().toString());
42
		LOGGER.info("requested url : "+request.getRequestURL().toString());
44
		@SuppressWarnings("unchecked")
43
		@SuppressWarnings("unchecked")
45
		final Map<String, Object>  createShopMap = (Map<String, Object>)request.getAttribute(ProfitMandiConstants.CREATE_SHOP_MAP);
44
		final Map<String, Object>  createShopMap = (Map<String, Object>)request.getAttribute(ProfitMandiConstants.CREATE_SHOP_MAP);
46
		request.removeAttribute(ProfitMandiConstants.CREATE_SHOP_MAP);
45
		request.removeAttribute(ProfitMandiConstants.CREATE_SHOP_MAP);
47
		
46
		
Line 120... Line 119...
120
	}
119
	}
121
	
120
	
122
	
121
	
123
	
122
	
124
	@RequestMapping(value = ProfitMandiConstants.URL_SHOP_ID, method=RequestMethod.DELETE)
123
	@RequestMapping(value = ProfitMandiConstants.URL_SHOP_ID, method=RequestMethod.DELETE)
125
	public ResponseEntity<?> deleteById(HttpServletRequest request, @RequestParam(name = "id") String id){
124
	public ResponseEntity<?> removeById(HttpServletRequest request, @RequestParam(name = "id") String id){
126
		LOGGER.info("requested url : "+request.getRequestURL().toString());
125
		LOGGER.info("requested url : "+request.getRequestURL().toString());
127
		try {
126
		try {
128
			shopRepository.deleteById(id);
127
			shopRepository.deleteById(id);
129
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, ResponseCodeHolder.getMessage("API_OK_1001"));
128
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, ResponseCodeHolder.getMessage("API_OK_1001"));
130
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
129
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);