11package br .edu .ufrn .user .controller ;
22
3+ import java .util .List ;
4+
35import org .springframework .beans .factory .annotation .Autowired ;
4- import org .springframework .http .MediaType ;
56import org .springframework .web .bind .annotation .DeleteMapping ;
67import org .springframework .web .bind .annotation .GetMapping ;
78import org .springframework .web .bind .annotation .PathVariable ;
1314import br .edu .ufrn .user .record .CreateUserDTO ;
1415import br .edu .ufrn .user .record .UserDTO ;
1516import br .edu .ufrn .user .service .UserService ;
16- import reactor .core .publisher .Flux ;
17- import reactor .core .publisher .Mono ;
1817
1918@ RestController
2019@ RequestMapping ("/users" )
@@ -23,24 +22,24 @@ public class UserRestAPIController {
2322 @ Autowired
2423 private UserService userService ;
2524
26- @ GetMapping ( produces = MediaType . TEXT_EVENT_STREAM_VALUE )
27- public Flux <UserDTO > getAll () {
25+ @ GetMapping
26+ public List <UserDTO > getAll () {
2827 return userService .getAll ();
2928 }
3029
3130 @ GetMapping ("/{id}" )
32- public Mono < UserDTO > getById (@ PathVariable String id ) {
31+ public UserDTO getById (@ PathVariable String id ) {
3332 return userService .getById (id );
3433 }
3534
3635 @ PostMapping
37- public Mono < UserDTO > save (@ RequestBody CreateUserDTO createUserDTO ) {
36+ public UserDTO save (@ RequestBody CreateUserDTO createUserDTO ) {
3837 return userService .save (createUserDTO );
3938 }
4039
4140 @ DeleteMapping ("/{id}" )
42- public Mono < Void > delete (@ PathVariable String id ) {
43- return userService .delete (id );
41+ public void delete (@ PathVariable String id ) {
42+ userService .delete (id );
4443 }
4544
4645}
0 commit comments