package com.kwan.springbootkwan.controller; import com.kwan.springbootkwan.entity.User; import com.kwan.springbootkwan.service.IUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/user") public class UserController { @Autowired private IUserService userService; @RequestMapping(value = "/all", method = RequestMethod.GET) public List<User> addAdvertise() { return userService.getUsers(); } @RequestMapping(value = "/getUserById/{id}", method = RequestMethod.GET) public User getUserById(@PathVariable Integer id) { return userService.getUserById(id); } }