package com.ssj.bean.sys.game.domain;

import com.ssj.bean.common.framework.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Version;
import java.util.Date;

/**
 * 小程序游戏排行榜
 * @author Mount Liu
 * @date 2018/1/22
 */
@Entity
@Table(name = "tb_game_ranklist")
public class Ranklist extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    private String userId;
    /**
     * 名称
     */
    private String name;
    /**
     * 头像
     */
    private String photo;
    /**
     * 分数
     */
    private double score;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 年龄段（1：3岁~5岁；2:5岁~10岁；3：10岁~18岁；4:18岁以上）
     */
    private int ageGroup = -1;
    /**
     * 性别(1:男，2：女)
     */
    private int sex;
    /**
     * 当前关卡数
     */
    private int level = -1;
    /**
     * 版本号
     */
    private int version;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Column(updatable=false)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public double getScore() {
        return score;
    }

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

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public int getAgeGroup() {
        return ageGroup;
    }

    public void setAgeGroup(int ageGroup) {
        this.ageGroup = ageGroup;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
    @Version
    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }
}
