Subversion Repositories SmartDukaan

Rev

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

Rev 21426 Rev 21431
Line 66... Line 66...
66
		LOGGER.info("requested url : "+request.getRequestURL().toString());
66
		LOGGER.info("requested url : "+request.getRequestURL().toString());
67
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, shopRepository.selectAll());
67
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, shopRepository.selectAll());
68
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
68
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
69
	}
69
	}
70
	@RequestMapping(value = ProfitMandiConstants.URL_SHOP_ID, method=RequestMethod.GET)
70
	@RequestMapping(value = ProfitMandiConstants.URL_SHOP_ID, method=RequestMethod.GET)
71
	public ResponseEntity<?> getById(HttpServletRequest request, @RequestParam(name = "id") long id){
71
	public ResponseEntity<?> getById(HttpServletRequest request, @RequestParam(name = "id") int id){
72
		LOGGER.info("requested url : "+request.getRequestURL().toString());
72
		LOGGER.info("requested url : "+request.getRequestURL().toString());
73
		try {
73
		try {
74
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, shopRepository.selectById(id));
74
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, shopRepository.selectById(id));
75
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
75
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
76
		}catch (ProfitMandiBusinessException pmbe) {
76
		}catch (ProfitMandiBusinessException pmbe) {
Line 96... Line 96...
96
	}
96
	}
97
	
97
	
98
	
98
	
99
	
99
	
100
	@RequestMapping(value = ProfitMandiConstants.URL_SHOP_ID, method=RequestMethod.DELETE)
100
	@RequestMapping(value = ProfitMandiConstants.URL_SHOP_ID, method=RequestMethod.DELETE)
101
	public ResponseEntity<?> removeById(HttpServletRequest request, @RequestParam(name = "id") long id){
101
	public ResponseEntity<?> removeById(HttpServletRequest request, @RequestParam(name = "id") int id){
102
		LOGGER.info("requested url : "+request.getRequestURL().toString());
102
		LOGGER.info("requested url : "+request.getRequestURL().toString());
103
		try {
103
		try {
104
			shopRepository.deleteById(id);
104
			shopRepository.deleteById(id);
105
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, ResponseCodeHolder.getMessage("API_OK_1001"));
105
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, ResponseCodeHolder.getMessage("API_OK_1001"));
106
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
106
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);