mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	【代码优化】全局:Area 在 IDEA debug 时 toString 方法报错StackOverflowError、指定 jackson 默认序列化时双向引用的前向、后向出口避免死循环报错
This commit is contained in:
		| @@ -1,9 +1,11 @@ | ||||
| package cn.iocoder.yudao.framework.ip.core; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum; | ||||
| import com.fasterxml.jackson.annotation.JsonManagedReference; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| import lombok.ToString; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| @@ -17,6 +19,7 @@ import java.util.List; | ||||
| @Data | ||||
| @AllArgsConstructor | ||||
| @NoArgsConstructor | ||||
| @ToString(exclude = {"parent"}) // 参见 https://gitee.com/yudaocode/yudao-cloud-mini/pulls/2 原因 | ||||
| public class Area { | ||||
|  | ||||
|     /** | ||||
| @@ -46,10 +49,12 @@ public class Area { | ||||
|     /** | ||||
|      * 父节点 | ||||
|      */ | ||||
|     @JsonManagedReference | ||||
|     private Area parent; | ||||
|     /** | ||||
|      * 子节点 | ||||
|      */ | ||||
|     @JsonManagedReference | ||||
|     private List<Area> children; | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV