Closed chenshun00 closed 3 years ago
嗯,我去试试
效果变成这样了
不过这样也能满足我的需求.
package com.itangcent.springboot.demo.controller;
import jdk.nashorn.internal.objects.annotations.Getter;
import jdk.nashorn.internal.objects.annotations.Setter;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
/**
* @author luobo.cs@raycloud.com
* @since 2021/5/18 10:46 上午
*/
@RestController
@RequestMapping(value = "/test/nested")
public class NestdController {
@RequestMapping("/first")
public NestedResponse nestedTest(@RequestParam Integer id) {
return new NestedResponse();
}
public static class NestedResponse {
/**
* 总计
*/
private Long total;
/**
* 数据
*/
private List<First> datas;
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public List<First> getDatas() {
return datas;
}
public void setDatas(List<First> datas) {
this.datas = datas;
}
/**
* 第一个
*
* @author luobo.cs@raycloud.com
* @since 2021/05/18
*/
public static class First {
/**
* 的名字
*/
private String name;
/**
* 年龄
*/
private Integer age;
/**
* 生日
*/
private Date birthday;
/**
* 第一个来源
*/
private First sourceFirst;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public First getSourceFirst() {
return sourceFirst;
}
public void setSourceFirst(First sourceFirst) {
this.sourceFirst = sourceFirst;
}
}
}
}
看了下代码变更的地方
val paramType = param.getType() ?: continue
val unboxType = paramType.unbox()
以前的版本用的 unboxType
,新的版本用的 paramType
类试于这种情况导出,会有套娃的情况. :( 不知道是不是我使用有问题