Created
March 29, 2024 01:15
-
-
Save httpmurilo/e7f29bfb97a7284b8ed1cc6fbec000be to your computer and use it in GitHub Desktop.
UserController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping("/api/user") | |
public class UserController { | |
@Autowired | |
private IUserRepository repository; | |
@GetMapping(value = "/search") | |
public ResponseEntity<User> findByName(@RequestParam String name) { | |
var user = repository.getUserByName(name); | |
return ResponseEntity.ok((User) user); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment