@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参数选择

本文介绍了一种通过SpringMVC框架实现的CID列表推送方法,该方法接收内容、标题、URL及CID列表作为参数,并使用POST请求进行模拟。
3470

被折叠的 条评论
为什么被折叠?



