java前后分离了 controller接口GET和POST

通用

@RestController

GET

    @RequestMapping("userbase/{userId}") public User selectById(@PathVariable Integer userId) {
    }
        

POST

    @RequestMapping("userbase")
    public UserBaseInfo selectById(@RequestParam(name = "userid", required = true) Integer userId){
        System.out.println( userId);
        UserBaseInfo userBaseInfo = userBaseInfoService.selectById(userId);
        System.out.println( userBaseInfo);
        return userBaseInfo;
    }

 

posted @ 2019-08-21 06:15  ThisCall  阅读(1435)  评论(0编辑  收藏  举报