Skip to content

Commit 1878d96

Browse files
committed
small changes
1 parent 3814374 commit 1878d96

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

src/main/java/br/edu/ufrn/user/controller/UserGraphQLController.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
@Controller
1616
public 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
}

src/main/java/br/edu/ufrn/user/controller/UserRestAPIController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.springframework.web.bind.annotation.PathVariable;
88
import org.springframework.web.bind.annotation.PostMapping;
99
import org.springframework.web.bind.annotation.RequestBody;
10+
import org.springframework.web.bind.annotation.RequestMapping;
1011
import org.springframework.web.bind.annotation.RestController;
1112

1213
import br.edu.ufrn.user.record.CreateUserDTO;
@@ -16,7 +17,9 @@
1617
import reactor.core.publisher.Mono;
1718

1819
@RestController
20+
@RequestMapping("/users")
1921
public 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
}

src/main/java/br/edu/ufrn/user/service/UserService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
@Service
1414
public 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
}

src/main/resources/graphql/schema.graphqls

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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

2019
type Query {
21-
getAll: [User!]!
20+
getAll: [User]!
2221
getById(id: String!): User
2322
}
2423

2524
# Mutations
2625

2726
type Mutation {
28-
save(createUserInput: CreateUserInput!): User
27+
save(createUserInput: CreateUserInput!): User!
2928
delete(id: String!): Boolean
3029
}

0 commit comments

Comments
 (0)