简体   繁体   English

在Spring Rest中映射100个以上的url参数获取请求

[英]Mapping 100+ url parameters in a spring rest get request

I'm bit curious about mapping more than 100 request params in a single get request as request params without using any complex objects. 我对在单个get请求中将100多个请求参数映射为请求参数而不使用任何复杂对象感到有些好奇。

Example

public ResponseEntitiy<> getCustomerDetails (String params...) 

Is there any cool way to achieve this without writing them one by one. 有没有一种很酷的方法可以做到这一点而无需一一编写。

Interpretation of "cool" is very subjective. 解释“酷”是很主观的。

If you imply to have an implicit way of mapping request parameters, maybe using a Map<String, String> is a plausible solution: 如果您暗示有映射请求参数的隐式方式,则可以使用Map<String, String>是一个可行的解决方案:

public ResponseEntity<> getCustomerDetails
    (@RequestParam Map<String, String> params) {}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM