Postman中GET请求传入date[]类型参数
后台接口代码
@GetMapping("/pagelist")
public RespPageBean getEmployeeByPage(@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size,
UserInfo userInfo, Date[] beginDateScope) {
return userInfoService.getUserInfoByPage(page, size, userInfo, beginDateScope);
}
可以看到我们请求方式为get请求,参数中有Date[] beginDateScope为时间数组,用来设置查询时间段。可以设想beginDateScope[0] 为开始时间 beginDateScopep[1] 为结束时间
postman测试接口
接口地址拼接为:http://127.0.0.1:2222/userinfo/pagelist?page=1&size=2&beginDateScope=2020/08/13 12:00:30&beginDateScope=2020/08/13 12:55:35
注意:时间为:2020/08/13 12:55:35 格式
数组为:beginDateScope参数名一致的参数组成为beginDateScope[]
数组的第二种方式:
接口地址拼接后为:http://127.0.0.1:2222/userinfo/pagelist?page=1&size=2&beginDateScope=2020/08/13 12:00:30,2020/08/13 12:55:35