package com.sheep.gamegroup.model.entity;


import java.util.Locale;

/**
 * Created by realicing on 2018/5/9.
 * realicing@sina.com
 */
public class RechargeQQLog implements ILog{
    private float amount;

    private int status;

    private int discount;

    private int id;

    private int success_time;

    private String qq;

    private String order_no;

    private int from;

    private int user_id;

    private int create_time;
    private boolean isSelect;

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    public void setAmount(float amount){
        this.amount = amount;
    }
    public float getAmount(){
        return this.amount;
    }
    public void setStatus(int status){
        this.status = status;
    }
    public int getStatus(){
        return this.status;
    }
    public void setDiscount(int discount){
        this.discount = discount;
    }
    public int getDiscount(){
        return this.discount;
    }
    public void setId(int id){
        this.id = id;
    }
    public int getId(){
        return this.id;
    }
    public void setSuccess_time(int success_time){
        this.success_time = success_time;
    }
    public int getSuccess_time(){
        return this.success_time;
    }
    public void setQq(String qq){
        this.qq = qq;
    }
    public String getQq(){
        return this.qq;
    }
    public void setOrder_no(String order_no){
        this.order_no = order_no;
    }
    public String getOrder_no(){
        return this.order_no;
    }
    public void setFrom(int from){
        this.from = from;
    }
    public int getFrom(){
        return this.from;
    }
    public void setUser_id(int user_id){
        this.user_id = user_id;
    }
    public int getUser_id(){
        return this.user_id;
    }
    public void setCreate_time(int create_time){
        this.create_time = create_time;
    }
    public int getCreate_time(){
        return this.create_time;
    }

    @Override
    public boolean equals(Object obj) {
        return obj instanceof RechargeQQLog && ((RechargeQQLog) obj).id == id;
    }

    /**
     * status 1充值中 2成功 3失败
     * @return
     */
    @Override
    public String getStateText() {
        switch (status){
            case 1:
                return "充值中";
            case 3:
                return "充值失败";
        }
        return "充值成功";
    }

    @Override
    public String getEventText() {
        return String.format(Locale.CHINA,"Q币充值%.2f元", amount);
    }

    @Override
    public boolean isEventSuccess() {
        return status == 2;
    }

    @Override
    public long getEventTime() {
        return create_time;
    }

    @Override
    public void isSelect(boolean b) {
        setSelect(b);
    }

    @Override
    public boolean getSelect() {
        return isSelect();
    }
}