@RequestMapping(value="/pushToCidList/link",method=RequestMethod.POST)
public HttpResult pushToCidListLink(
@RequestParam("content") String content,
@RequestParam("title") String title,
@RequestParam("url") String url,
@RequestBody List<String> cids
) {
LinkTemplatePushModel pushModel = new LinkTemplatePushModel();
pushModel.setContent(content);
pushModel.setTitle(title);
pushModel.setUrl(url);
HttpResult result = new HttpResult(true,"");
return result;//appPushService.pushToCidList(cids, pushModel);
}
POSTMAN进行模拟:
使用SpringMVC框架,controller使用参数 @RequestBody LoginReq req 注解方式模拟http请求
需要请求header添加两个参数
设置 Header参数 Content-Type application/json
body参数选择