Skip to content
Snippets Groups Projects
Select Git revision
  • cfaa8fb5d675d551d27d9b3916f1325ba5af7366
  • main default protected
2 results

UserLibraryController.java

Blame
  • UserLibraryController.java 737 B
    package com.example.livecodingjavaspring;
    
    import lombok.RequiredArgsConstructor;
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestParam;
    import org.springframework.web.bind.annotation.RestController;
    
    import java.util.List;
    
    @RestController
    @RequestMapping("users")
    @RequiredArgsConstructor
    public class UserLibraryController {
        private final UserDao userDao;
        @GetMapping("helloWord")
        public String helloWord(@RequestParam String name) {
            return "Coucou " + name + " ! Tu vas bien ?";
        }
    
        @GetMapping("")
        public List<User> getUsers() {
            return userDao.getUsers();
        }
    
    }