对比新文件 |
| | |
| | | package com.iailab.framework.ip.core; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonManagedReference; |
| | | import com.iailab.framework.ip.core.enums.AreaTypeEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.ToString; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 区域节点,包括国家、省份、城市、地区等信息 |
| | | * |
| | | * 数据可见 resources/area.csv 文件 |
| | | * |
| | | * @author iailab |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ToString(exclude = {"parent"}) |
| | | public class Area { |
| | | |
| | | /** |
| | | * 编号 - 全球,即根目录 |
| | | */ |
| | | public static final Integer ID_GLOBAL = 0; |
| | | /** |
| | | * 编号 - 中国 |
| | | */ |
| | | public static final Integer ID_CHINA = 1; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | private Integer id; |
| | | /** |
| | | * 名字 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 类型 |
| | | * |
| | | * 枚举 {@link AreaTypeEnum} |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 父节点 |
| | | */ |
| | | @JsonManagedReference |
| | | private Area parent; |
| | | /** |
| | | * 子节点 |
| | | */ |
| | | @JsonManagedReference |
| | | private List<Area> children; |
| | | |
| | | } |