Subversion Repositories SmartDukaan

Rev

Rev 21426 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21426 Rev 21431
Line 56... Line 56...
56
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, apiRepository.selectAll());
56
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, apiRepository.selectAll());
57
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
57
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
58
		
58
		
59
	}
59
	}
60
	@RequestMapping(value = ProfitMandiConstants.URL_API_ID,method=RequestMethod.GET)
60
	@RequestMapping(value = ProfitMandiConstants.URL_API_ID,method=RequestMethod.GET)
61
	public ResponseEntity<?> getById(HttpServletRequest request, @RequestParam(name = "id") long id){
61
	public ResponseEntity<?> getById(HttpServletRequest request, @RequestParam(name = "id") int id){
62
		LOGGER.info("requested url : "+request.getRequestURL().toString());
62
		LOGGER.info("requested url : "+request.getRequestURL().toString());
63
		try {
63
		try {
64
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, apiRepository.selectById(id));
64
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, apiRepository.selectById(id));
65
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
65
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
66
		}catch (ProfitMandiBusinessException pmbe) {
66
		}catch (ProfitMandiBusinessException pmbe) {
Line 92... Line 92...
92
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
92
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
93
		
93
		
94
	}
94
	}
95
	
95
	
96
	@RequestMapping(value = ProfitMandiConstants.URL_API_ID,method=RequestMethod.DELETE)
96
	@RequestMapping(value = ProfitMandiConstants.URL_API_ID,method=RequestMethod.DELETE)
97
	public ResponseEntity<?> deleteById(HttpServletRequest request, @RequestParam(name = "id") long id){
97
	public ResponseEntity<?> deleteById(HttpServletRequest request, @RequestParam(name = "id") int id){
98
		LOGGER.info("requested url : "+request.getRequestURL().toString());
98
		LOGGER.info("requested url : "+request.getRequestURL().toString());
99
		try {
99
		try {
100
			apiRepository.deleteById(id);
100
			apiRepository.deleteById(id);
101
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, ResponseCodeHolder.getMessage("API_OK_1001"));
101
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, ResponseCodeHolder.getMessage("API_OK_1001"));
102
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
102
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);