package com.sheep.gamegroup.model.entity;


import com.lqr.emoji.EmotionLayout;
import com.sheep.gamegroup.util.ApiJSONUtil;

/**
 * Created by realicing on 2018/11/1.
 * realicing@sina.com
 * update_time:	integer ($int64)
 * level:	integer ($int32)
 * 评分等级 1-5
 * app_name:	string
 * 应用名称
 * nickname:	string
 * 昵称
 * user_id:	integer ($int64)
 * 用户id
 * create_time:	integer ($int64)
 * score:	integer ($int32)
 * 评分 1-10
 * status:	integer ($int32)
 * 审核状态 1：通过 2：未通过
 * like:	integer ($int64)
 * 点赞数
 * app_icon:	string
 * 应用图标
 * expression:	integer ($int64)
 * 表情数
 * app_type:	integer ($int32)
 * 评论类型 1：游戏
 * content:	string
 * 评论内容
 * avatar:	string
 * 头像
 * app_id:	integer ($int64)
 * 评论应用id
 * id:	integer ($int64)
 * comment:	integer ($int64)
 * 评论数
 * <p>
 * 用户评论
 */
public class UserComment {

    private int id;

    private int user_id;

    private int app_id;

    private String app_name;

    private String app_icon;

    private int app_type;

    private String nickname;

    private String avatar;

    private int like;

    private int expression;

    private int comment;

    private int score;

    private int level;

    private int status;

    private String content;

    private int create_time;

    private int update_time;

    public void setId(int id) {
        this.id = id;
    }

    public int getId() {
        return this.id;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }

    public int getUser_id() {
        return this.user_id;
    }

    public void setApp_id(int app_id) {
        this.app_id = app_id;
    }

    public int getApp_id() {
        return this.app_id;
    }

    public void setApp_name(String app_name) {
        this.app_name = app_name;
    }

    public String getApp_name() {
        return this.app_name;
    }

    public void setApp_icon(String app_icon) {
        this.app_icon = app_icon;
    }

    public String getApp_icon() {
        return this.app_icon;
    }

    public void setApp_type(int app_type) {
        this.app_type = app_type;
    }

    public int getApp_type() {
        return this.app_type;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getNickname() {
        return this.nickname;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getAvatar() {
        return this.avatar;
    }

    public void setLike(int like) {
        this.like = like;
    }

    public int getLike() {
        return this.like;
    }

    public void setExpression(int expression) {
        this.expression = expression;
    }

    public int getExpression() {
        return this.expression;
    }

    public void setComment(int comment) {
        this.comment = comment;
    }

    public int getComment() {
        return this.comment;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public int getScore() {
        return this.score;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getLevel() {
        return this.level;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getStatus() {
        return this.status;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContent() {
        return this.content;
    }

    public void setCreate_time(int create_time) {
        this.create_time = create_time;
    }

    public int getCreate_time() {
        return this.create_time;
    }

    public void setUpdate_time(int update_time) {
        this.update_time = update_time;
    }

    public int getUpdate_time() {
        return this.update_time;
    }


    private ShowAll showAll;

    public ShowAll getShowAll() {
        if (showAll == null){
            boolean hasExp = EmotionLayout.hasExp(content);
            showAll = new ShowAll(hasExp ? EmotionLayout.changeContent(content) : content);
            showAll.setHasExp(hasExp);
        }
        return showAll;
    }

    //表情点赞数量加一
    public void plusExpression() {
        expression++;
    }
    //点赞数量加一
    public void plusLike() {
        like++;
    }

    //是否是游戏资讯的用户评论
    public boolean isArticleUserComment() {
        return ApiJSONUtil.COMMENT_TYPE_ARTICLE == app_type;
    }
}
