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

mac2022-06-30  91

通用

@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; }

 

转载于:https://www.cnblogs.com/dianzan/p/11386577.html

最新回复(0)