View Javadoc
1   package com.foxinmy.weixin4j.qy.model;
2   
3   import java.io.Serializable;
4   
5   import com.alibaba.fastjson.annotation.JSONField;
6   
7   /**
8    * 部门对象
9    *
10   * @className Party
11   * @author jinyu(foxinmy@gmail.com)
12   * @date 2014年11月18日
13   * @since JDK 1.6
14   */
15  public class Party implements Serializable {
16  
17  	private static final long serialVersionUID = -2567893218591084288L;
18  	/**
19  	 * 部门ID,指定时必须大于1,不指定时则自动生成.
20  	 */
21  	private int id;
22  	/**
23  	 * 部门名称。长度限制为32个字(汉字或英文字母),字符不能包括\:*?"<>|
24  	 */
25  	private String name;
26  	/**
27  	 * 父亲部门id。根部门id为1
28  	 */
29  	@JSONField(name = "parentid")
30  	private int parentId;
31  	/**
32  	 * 在父部门中的次序值。order值大的排序靠前。有效的值范围是[0, 2^32)
33  	 */
34  	private long order;
35  
36  	protected Party() {
37  
38  	}
39  
40  	public Party(String name) {
41  		this.name = name;
42  	}
43  
44  	public Party(int id, String name, int parentId) {
45  		this.id = id;
46  		this.name = name;
47  		this.parentId = parentId;
48  	}
49  
50  	public int getId() {
51  		return id;
52  	}
53  
54  	public String getName() {
55  		return name;
56  	}
57  
58  	public int getParentId() {
59  		return parentId;
60  	}
61  
62  	public long getOrder() {
63  		return order;
64  	}
65  
66  	// ---------- setter 应该全部去掉
67  
68  	public void setId(int id) {
69  		this.id = id;
70  	}
71  
72  	public void setName(String name) {
73  		this.name = name;
74  	}
75  
76  	public void setParentId(int parentId) {
77  		this.parentId = parentId;
78  	}
79  
80  	public void setOrder(long order) {
81  		this.order = order;
82  	}
83  
84  	@Override
85  	public String toString() {
86  		return "Party [id=" + id + ", name=" + name + ", parentId=" + parentId
87  				+ ", order=" + order + "]";
88  	}
89  }