您的位置:首页 > 编程语言 > Java开发

SpringBoot 参数传递的问题

2018-01-24 13:41 225 查看
1、字段少的话 最好使用@Requestparam 的Key-value形式

前段所传的参数为对象

@PostMapping("/getCashFlowSeq")
public ResultJson getCashFlowSeq(@RequestHeader("tenantUid") String tenantUid,
@RequestParam("accsetUid") String accSetUid, @RequestParam("period") String period) {
return cashJournalAccountService.getCashFlowSeq(accSetUid, period);
}


2、所传的字段为List<String>的形式,用@Requestparam来修饰传递参数 所传对象为对象

@PostMapping("/getCashFlowSeq")
public ResultJson getCashFlowSeq(@RequestHeader("tenantUid") String tenantUid,
@RequestParam("ids") List<String> ids) {

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: