Last active
October 15, 2023 00:23
-
-
Save vepo/01fb0a608ef123bfa956f0f328163616 to your computer and use it in GitHub Desktop.
This file contains 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
@Path("/user") // JAX-RS | |
@ApplicationScoped // CDI | |
public class UserEndpoint { | |
@GET | |
@Produces(MediaType.APPLICATION_JSON) | |
public UserListResponse listUsers() { | |
// List os usuários | |
} | |
@POST | |
@Produces(MediaType.APPLICATION_JSON) | |
@Consumes(MediaType.APPLICATION_JSON) | |
public NewUserResponse newUser(NewUserRequest request) { | |
// Crie novo usuário | |
} | |
@DELETE | |
@Path("{id}") | |
public void deleteUser(@PathParam("id") Long id) { | |
// Remova o usuário | |
} | |
} |
This file contains 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 | |
public class UserEndpoint { | |
@GetMapping("/user") | |
public UserListResponse listUsers() { | |
// List os usuários | |
} | |
@PostMapping("/user") | |
public NewUserResponse newUser(@RequestBody NewUserRequest request) { | |
// Crie novo usuário | |
} | |
@DeleteMapping("/user/{id}") | |
public void deleteUser(@PathVariable Long id) { | |
// Remova o usuário | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment