File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1414
1515@ Controller
1616public class UserGraphQLController {
17+
1718 @ Autowired
1819 private UserService userService ;
1920
@@ -36,4 +37,5 @@ public Mono<UserDTO> save(@Argument("createUserInput") CreateUserDTO createUserD
3637 public Mono <Void > delete (@ Argument String id ) {
3738 return userService .delete (id );
3839 }
40+
3941}
Original file line number Diff line number Diff line change 77import org .springframework .web .bind .annotation .PathVariable ;
88import org .springframework .web .bind .annotation .PostMapping ;
99import org .springframework .web .bind .annotation .RequestBody ;
10+ import org .springframework .web .bind .annotation .RequestMapping ;
1011import org .springframework .web .bind .annotation .RestController ;
1112
1213import br .edu .ufrn .user .record .CreateUserDTO ;
1617import reactor .core .publisher .Mono ;
1718
1819@ RestController
20+ @ RequestMapping ("/users" )
1921public class UserRestAPIController {
22+
2023 @ Autowired
2124 private UserService userService ;
2225
@@ -39,4 +42,5 @@ public Mono<UserDTO> save(@RequestBody CreateUserDTO createUserDTO) {
3942 public Mono <Void > delete (@ PathVariable String id ) {
4043 return userService .delete (id );
4144 }
45+
4246}
Original file line number Diff line number Diff line change 1212
1313@ Service
1414public class UserService {
15+
1516 @ Autowired
1617 private UserRepository userRepository ;
1718
@@ -59,4 +60,5 @@ public Mono<UserDTO> save(CreateUserDTO createUserDTO) {
5960 public Mono <Void > delete (String id ) {
6061 return userRepository .deleteById (id );
6162 }
63+
6264}
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ type User {
55 name : String !
66 age : Int !
77 createdAt : String !
8- updatedAt : String !
98}
109
1110# Inputs
@@ -18,13 +17,13 @@ input CreateUserInput {
1817# Queries
1918
2019type Query {
21- getAll : [User ! ]!
20+ getAll : [User ]!
2221 getById (id : String ! ): User
2322}
2423
2524# Mutations
2625
2726type Mutation {
28- save (createUserInput : CreateUserInput ! ): User
27+ save (createUserInput : CreateUserInput ! ): User !
2928 delete (id : String ! ): Boolean
3029}
You can’t perform that action at this time.
0 commit comments