Skip to content

Commit

Permalink
Refactor old autowire style
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsarm committed Feb 23, 2023
1 parent d38352f commit ac62fd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class SpringDataJpaUserDetailsService implements UserDetailsService {

private final UserRepository repository;

@Autowired
public SpringDataJpaUserDetailsService(UserRepository repository) {
this.repository = repository;
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/ar/com/mrdev/app/user/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@RestController
public class UserController {

@Autowired UserService userService;
final UserService userService;

/**
* To update the profile without modifying the
Expand All @@ -41,4 +41,8 @@ public class UserController {
public User updateProfile(HttpServletRequest request, @PathVariable Long id, @Validated @RequestBody User user) {
return userService.updateProfile(id, user, request.isUserInRole(ROLE_MANAGER));
}

public UserController(UserService userService) {
this.userService = userService;
}
}

0 comments on commit ac62fd9

Please sign in to comment.