以下是我的代码
@RestController
@RequestMapping(value="/users")
public class UserController {
@Autowired
private UserService userService;
@RequestMapping(value ="/registration",method = RequestMethod.POST)
public void addUser(@RequestBody @Valid UserDTO userDTO) {
System.out.println("from Post");
userService.saveUser(userDTO);
}
@RequestMapping(value = "/dashboard/getUserDetails", method = RequestMethod.GET)
public List<UserDTO> getUsers() {
System.out.println("inside controller");
return userService.getUsers();
}}
在上面的代码中,当我试图让get endpoint工作时,当我试图点击POST端点时它会抛出404.
请帮助我解决问题