View Javadoc
1   package com.foxinmy.weixin4j.mp.datacube;
2   
3   import java.io.Serializable;
4   import java.util.Date;
5   
6   import com.alibaba.fastjson.annotation.JSONField;
7   import com.foxinmy.weixin4j.mp.type.ShareSourceType;
8   
9   /**
10   * 数据统计:图文分享数据
11   * 
12   * @className ArticleDatacubeShare
13   * @author jinyu(foxinmy@gmail.com)
14   * @date 2015年1月30日
15   * @since JDK 1.6
16   * @see
17   */
18  public class ArticleDatacubeShare implements Serializable {
19  	private static final long serialVersionUID = 3841239305410294553L;
20  
21  	/**
22  	 * 数据的日期
23  	 */
24  	@JSONField(name = "ref_date")
25  	private Date refDate;
26  	/**
27  	 * 数据的小时,包括从000到2300,分别代表的是[000,100)到[2300,2400),即每日的第1小时和最后1小时
28  	 */
29  	@JSONField(name = "ref_hour")
30  	private int refHour;
31  	/**
32  	 * 分享的人数
33  	 */
34  	@JSONField(name = "shareUser")
35  	private int shareUser;
36  	/**
37  	 * 分享的次数
38  	 */
39  	@JSONField(name = "shareCount")
40  	private int shareCount;
41  	/**
42  	 * 分享的场景
43  	 */
44  	@JSONField(name = "share_scene")
45  	private int shareScene;
46  
47  	public Date getRefDate() {
48  		return refDate;
49  	}
50  
51  	public void setRefDate(Date refDate) {
52  		this.refDate = refDate;
53  	}
54  
55  	public int getRefHour() {
56  		return refHour;
57  	}
58  
59  	public void setRefHour(int refHour) {
60  		this.refHour = refHour;
61  	}
62  
63  	public int getShareUser() {
64  		return shareUser;
65  	}
66  
67  	public void setShareUser(int shareUser) {
68  		this.shareUser = shareUser;
69  	}
70  
71  	public int getShareCount() {
72  		return shareCount;
73  	}
74  
75  	public void setShareCount(int shareCount) {
76  		this.shareCount = shareCount;
77  	}
78  
79  	public int getShareScene() {
80  		return shareScene;
81  	}
82  
83  	@JSONField(serialize = false)
84  	public ShareSourceType getFormatShareScene() {
85  		if (shareScene == 1) {
86  			return ShareSourceType.FRIENDFORWARD;
87  		} else if (shareScene == 2) {
88  			return ShareSourceType.FRIENDSCIRCLE;
89  		} else if (shareScene == 3) {
90  			return ShareSourceType.TENCENTWEIBO;
91  		} else {
92  			return ShareSourceType.OTHER;
93  		}
94  	}
95  
96  	public void setShareScene(int shareScene) {
97  		this.shareScene = shareScene;
98  	}
99  
100 	@Override
101 	public String toString() {
102 		return "ArticleDatacubeShare [refDate=" + refDate + ", refHour="
103 				+ refHour + ", shareUser=" + shareUser + ", shareCount="
104 				+ shareCount + ", shareScene=" + shareScene + "]";
105 	}
106 }