我拆过的坑cycx

查询一下!

@GetMapping("{id}")

@RestController

@RequestMapping("user")

public class RestFullController {

    @GetMapping

    public User get(){

        User user = new User(1,"2wa","man",9);

        return user;

    }



    @GetMapping("{id}")

    public User getById(@PathVariable("id") int id){

        User user = new User(id,"3wa","woman",9);

        return user;

    }

}


发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.7.3

Copyright Your WebSite.Some Rights Reserved.