提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.framework.ip.core; |
H |
2 |
|
4a47e4
|
3 |
import com.fasterxml.jackson.annotation.JsonManagedReference; |
e7c126
|
4 |
import com.iailab.framework.ip.core.enums.AreaTypeEnum; |
H |
5 |
import lombok.AllArgsConstructor; |
|
6 |
import lombok.Data; |
|
7 |
import lombok.NoArgsConstructor; |
4a47e4
|
8 |
import lombok.ToString; |
e7c126
|
9 |
|
H |
10 |
import java.util.List; |
|
11 |
|
|
12 |
/** |
|
13 |
* 区域节点,包括国家、省份、城市、地区等信息 |
|
14 |
* |
|
15 |
* 数据可见 resources/area.csv 文件 |
|
16 |
* |
|
17 |
* @author iailab |
|
18 |
*/ |
|
19 |
@Data |
|
20 |
@AllArgsConstructor |
|
21 |
@NoArgsConstructor |
4a47e4
|
22 |
@ToString(exclude = {"parent"}) |
e7c126
|
23 |
public class Area { |
H |
24 |
|
|
25 |
/** |
|
26 |
* 编号 - 全球,即根目录 |
|
27 |
*/ |
|
28 |
public static final Integer ID_GLOBAL = 0; |
|
29 |
/** |
|
30 |
* 编号 - 中国 |
|
31 |
*/ |
|
32 |
public static final Integer ID_CHINA = 1; |
|
33 |
|
|
34 |
/** |
|
35 |
* 编号 |
|
36 |
*/ |
|
37 |
private Integer id; |
|
38 |
/** |
|
39 |
* 名字 |
|
40 |
*/ |
|
41 |
private String name; |
|
42 |
/** |
|
43 |
* 类型 |
|
44 |
* |
|
45 |
* 枚举 {@link AreaTypeEnum} |
|
46 |
*/ |
|
47 |
private Integer type; |
|
48 |
|
|
49 |
/** |
|
50 |
* 父节点 |
|
51 |
*/ |
4a47e4
|
52 |
@JsonManagedReference |
e7c126
|
53 |
private Area parent; |
H |
54 |
/** |
|
55 |
* 子节点 |
|
56 |
*/ |
4a47e4
|
57 |
@JsonManagedReference |
e7c126
|
58 |
private List<Area> children; |
H |
59 |
|
|
60 |
} |