接口请求传参形式
@PostMapping("/getControlBasicInfoList.json")
public ResultEntity<LitePageInfo<ControlBasicInfoVo>> getControlBasicInfoList(@Valid @RequestBody ControlBasicInfoDTO controlBasicInfoDTO) {
return ResultEntity.success(controlBasicInfoService.getControlBasicInfoList(controlBasicInfoDTO));
}
@PostMapping("/deleteControlBasicInfo.json")
public ResultEntity<Boolean> deleteControlBasicInfo(@Valid @RequestBody ControlBasicInfoDTO controlBasicInfoDTO) {
return ResultEntity.success(controlBasicInfoService.deleteControlBasicInfo(controlBasicInfoDTO));
}
1.@RequestBody使用实体类传参 用@PostMapping
@GetMapping("/getControlBasicInfoList.json")
public LitePageInfo<ControlBasicInfoVo> getControlBasicInfoList(@RequestParam(value = "spaceCode",required = false) String spaceCode,
@RequestParam(value = "mac",required = false) String mac,
@RequestParam(value = "current",required = false) int current,
@RequestParam(value = "pageSize",required = false) int pageSize) {
return controlBasicInfoService.getControlBasicInfoList(spaceCode, mac,current,pageSize);
}
@GetMapping("/deleteControlBasicInfo.json")
public void deleteControlBasicInfo(@RequestParam(value = "id",required = false) Long id) {
controlBasicInfoService.deleteControlBasicInfo(id);
}
2.使用@RequestParam传参用@GetMapping