Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- service.createUser = function (user) {
- console.log("Service. Creating user ",user);
- return http({
- method: 'GET',
- url: '/user/createUser',
- contentType: 'application/json',
- data: {user: user}
- })
- };
- $scope.user = {
- firstName: "",
- lastName: "",
- email: "",
- password: "",
- roles: []
- };
- @RequestMapping(value = "/createUser", method = RequestMethod.GET)
- public boolean createUser(@RequestBody UserDTO userDTO) {
- System.out.println(userDTO);
- return true;
- }
- public class UserDTO {
- private Long id;
- private String email;
- private String firstName;
- private String lastName;
- private String password;
- private List<Role> roles;
- //getters and setters
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement