Skip to content

Instantly share code, notes, and snippets.

@kamalhm
Created January 10, 2021 18:03
Show Gist options
  • Save kamalhm/070e6a812f89ea63353513c6d2211fd7 to your computer and use it in GitHub Desktop.
Save kamalhm/070e6a812f89ea63353513c6d2211fd7 to your computer and use it in GitHub Desktop.
@RestController
@RequestMapping(value = "/api/member")
@RequiredArgsConstructor
public class MemberController {
private final MemberRepository memberRepository;
@GetMapping
public Flux<Member> getAll() {
return memberRepository.findAll();
}
@GetMapping(value = "/{name}")
public Mono<Member> getOne(@PathVariable String name) {
return memberRepository.findByName(name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment