View Javadoc
1   package com.foxinmy.weixin4j.mp.model;
2   
3   import com.alibaba.fastjson.annotation.JSONField;
4   
5   /**
6    * 文章评论
7    *
8    * @className ArticleComment
9    * @author jinyu
10   * @date May 19, 2017
11   * @since JDK 1.6
12   * @see
13   */
14  public class ArticleComment extends Comment {
15  
16  	private static final long serialVersionUID = -8506024679132313314L;
17  	@JSONField(name = "user_comment_id")
18  	private String id;// 用户评论id
19  	private String openid;// openid
20  	@JSONField(name = "comment_type")
21  	private int type;// 是否精选评论,0为即非精选,1为true,即精选
22  	private Comment reply; // 评论回复
23  
24  	public String getId() {
25  		return id;
26  	}
27  
28  	public void setId(String id) {
29  		this.id = id;
30  	}
31  
32  	public String getOpenid() {
33  		return openid;
34  	}
35  
36  	public void setOpenid(String openid) {
37  		this.openid = openid;
38  	}
39  
40  	public int getType() {
41  		return type;
42  	}
43  
44  	@JSONField(serialize = false)
45  	public ArticleCommentType getFormatType() {
46  		if (type == 0) {
47  			return ArticleCommentType.GENERAL;
48  		} else if (type == 1) {
49  			return ArticleCommentType.MARKELECT;
50  		} else {
51  			return null;
52  		}
53  	}
54  
55  	public void setType(int type) {
56  		this.type = type;
57  	}
58  
59  	public Comment getReply() {
60  		return reply;
61  	}
62  
63  	public void setReply(Comment reply) {
64  		this.reply = reply;
65  	}
66  
67  	public enum ArticleCommentType {
68  		GENERAL, // 普通评论
69  		MARKELECT // 精选评论
70  	}
71  }