1 Star 0 Fork 1

thinkyoutoo / security-1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
3-3_用户详情请求.md 453 Bytes
一键复制 编辑 原始数据 按行查看 历史
Corning Sun 提交于 2018-03-16 15:20 . 3-3 用户详情请求 代码重构

3-3 用户详情请求

编写用户详情服务

  • @PathVariable 映射 url 片段到 java 方法的参数
  • 在 url 声明中使用正则表达式
  • JsonView 控制 json 输出内容

JsonView 使用步骤

  • 使用接口来声明多个视图
  • 在值对象的 get 方法上指定视图
  • 在 Controller 方法上指定视图

代码重构

  • @GetMapping 等替代 @RequestMapping
  • UserController 类定义总的 @RequestMapping("/user")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/thinkyoutoo/security-1.git
git@gitee.com:thinkyoutoo/security-1.git
thinkyoutoo
security-1
security-1
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891