分享好用靠谱的,Chrome/谷歌浏览器插件
(.crx格式插件,也支持其他Chromium内核,例如:搜狗浏览器,星愿浏览器,百分浏览器,微软Edge...)

JSON Viewer – 见过的最美观,最可定制的JSON

点击下载:JSON_Viewer_0.18.1.crx

见过的最美观,最可定制的JSON / JSONP荧光笔~开源!

介绍与使用方法:

介绍:

1、下载插件视频

2、安装插件后重新加载页面,测试网址:https://jsonview.com/example.json

使用方法:

第一步:使用接口声明视图

public interface UserSimpleView{}; //使用jsonview第一步,使用接口声明视图
public interface UserDetailView extends UserSimpleView{};

第二步:在值对象的get方法上指定视图

@JsonView(UserSimpleView.class) //使用jsonview第二部,在值对象的get方法上指定视图
public String getUsername(){
return username;
}
@JsonView(UserDetailView.class)
public String getPassword(){
return password;
第三步:在Controller方法上指定视图
/**
* 用户详情的获取
* @param id
* @return
*/
@GetMapping(“/{id:\\d+}”) //正则表达式控制只能接受数字
@JsonView(User.UserDetailView.class) //使用jsonview第三步,在Controller方法上指定视图
public User getInfo(@PathVariable String id){
log.info(id);

User user = new User();
user.setUsername(“tom”);
return user;

}

 

赞(7)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址