@RequestMapping(method = RequestMethod.GET, value = ApiUrls.URL_USERS_USER) HttpEntity<Resource<User>> loadUser(@PathVariable Long user) { Resource<User> resource = this.userResourceAssembler.toResource(crmService.findById(user)); return new ResponseEntity<Resource<User>>(resource, HttpStatus.OK); }
@Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { com.jl.crm.services.User user = crmService.findUserByUsername(username); return new CrmUserDetails(user); }
@RequestMapping(method = RequestMethod.DELETE, value = ApiUrls.URL_USERS_USER) HttpEntity<Resource<User>> deleteUser(@PathVariable Long user) { Resource<User> userResource = userResourceAssembler.toResource(crmService.removeUser(user)); return new ResponseEntity<Resource<User>>(userResource, HttpStatus.OK); }