Commit ac39a805520eec6abe6b485cb33016cb5bd68180
Committed by
Gitee
!1 【代码优化】全局:Area 在 IDEA debug 时 toString 方法报错StackOverflowError、指定 jackson 默认序列化时双向引用的前向、后向出口避免死循环报错
Merge pull request !1 from 常柯柯/N/A
Showing
1 changed file
with
2 additions
and
1 deletions
yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/Area.java
| 1 | package cn.iocoder.yudao.framework.ip.core; | 1 | package cn.iocoder.yudao.framework.ip.core; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum; | 3 | import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum; |
| 4 | +import com.fasterxml.jackson.annotation.JsonBackReference; | ||
| 4 | import com.fasterxml.jackson.annotation.JsonManagedReference; | 5 | import com.fasterxml.jackson.annotation.JsonManagedReference; |
| 5 | import lombok.AllArgsConstructor; | 6 | import lombok.AllArgsConstructor; |
| 6 | import lombok.Data; | 7 | import lombok.Data; |
| @@ -54,7 +55,7 @@ public class Area { | @@ -54,7 +55,7 @@ public class Area { | ||
| 54 | /** | 55 | /** |
| 55 | * 子节点 | 56 | * 子节点 |
| 56 | */ | 57 | */ |
| 57 | - @JsonManagedReference | 58 | + @JsonBackReference |
| 58 | private List<Area> children; | 59 | private List<Area> children; |
| 59 | 60 | ||
| 60 | } | 61 | } |