Subversion Repositories SmartDukaan

Rev

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

Rev 21426 Rev 21431
Line 42... Line 42...
42
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, roleRepository.selectAll());
42
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, roleRepository.selectAll());
43
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
43
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
44
	}
44
	}
45
	
45
	
46
	@RequestMapping(value = ProfitMandiConstants.URL_ROLE_ID,method=RequestMethod.GET)
46
	@RequestMapping(value = ProfitMandiConstants.URL_ROLE_ID,method=RequestMethod.GET)
47
	public ResponseEntity<?> getById(HttpServletRequest request, @RequestParam(name = "id") long id){
47
	public ResponseEntity<?> getById(HttpServletRequest request, @RequestParam(name = "id") int id){
48
		LOGGER.info("requested url : "+request.getRequestURL().toString());
48
		LOGGER.info("requested url : "+request.getRequestURL().toString());
49
		try {
49
		try {
50
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, roleRepository.selectById(id));
50
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, roleRepository.selectById(id));
51
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
51
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
52
		}catch (ProfitMandiBusinessException pmbe) {
52
		}catch (ProfitMandiBusinessException pmbe) {
Line 86... Line 86...
86
			return new ResponseEntity<>(chatOnResponse,HttpStatus.BAD_REQUEST);
86
			return new ResponseEntity<>(chatOnResponse,HttpStatus.BAD_REQUEST);
87
		}
87
		}
88
	}
88
	}
89
	
89
	
90
	@RequestMapping(value = ProfitMandiConstants.URL_ROLE_ID,method=RequestMethod.DELETE)
90
	@RequestMapping(value = ProfitMandiConstants.URL_ROLE_ID,method=RequestMethod.DELETE)
91
	public ResponseEntity<?> deleteById(HttpServletRequest request, @RequestParam(name = "id") long id){
91
	public ResponseEntity<?> deleteById(HttpServletRequest request, @RequestParam(name = "id") int id){
92
		LOGGER.info("requested url : "+request.getRequestURL().toString());
92
		LOGGER.info("requested url : "+request.getRequestURL().toString());
93
		try {
93
		try {
94
			roleRepository.deleteById(id);
94
			roleRepository.deleteById(id);
95
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, ResponseCodeHolder.getMessage("ROL_OK_1001"));
95
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString(), HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, ResponseCodeHolder.getMessage("ROL_OK_1001"));
96
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
96
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);