代码拉取完成,页面将自动刷新
在SpringBoot Controller中使用自定义注解用JSONQuery简化解析Post提交的JSON
- SpringBoot Web/Aop
- Annotation
- JSONQuery
- MockMvc
//@PostMapping(value = "/post")
@RequestMapping(value = "/post", method = RequestMethod.POST)
public String hello(
@JSONBodyField Integer errno,
@JSONBodyField("user > user_name") String username,
@JSONBodyField("comment_info > [-1]") CommentInfo lastCommentInfo
) {
System.err.println("errno = " + errno);
System.err.println("username = " + username);
System.err.println("lastCommentInfo = " + lastCommentInfo);
return "{\"code\":\"200\"}";
}
- 使用SpringBoot Web模块创建一个Restful风格的接口服务
- 自定义注解的开发
- 使用Aop处理自定义注解
- 使用MockMvc编写单元测试
- SpringBoot 2.0.0
- JSONQuery 0.2.5
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型