📜  将字符串列表作为 PathVariable 传递给 api spring boot - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:29.991000             🧑  作者: Mango

代码示例1
GET http://localhost:8080/public/test/1,2,3,4

@RequestMapping(value="/test/{firstNameIds}", method=RequestMethod.GET)
@ResponseBody
public String test(@PathVariable String[] firstNameIds)
{
    // firstNameIds: [1,2,3,4]
    return "Dummy"; 
}