package com.sheep.gamegroup.model.entity;

import com.kfzs.duanduan.utils.NumberFormatUtils;
import com.sheep.gamegroup.util.TimeUtil;

import java.util.Locale;

/**
 * Created by realicing on 2018/9/4.
 * realicing@sina.com
 * AppId	integer($int64)
 关联的app_id

 CreatedAt	integer($int64)
 DeleteStatus	integer($int32)
 删除状态（1已删除，2未删除）

 EndTime	integer($int64)
 结束时间

 GiftContent	string
 礼包内容

 GiftName	string
 礼包名称

 Id	integer($int64)
 Order	integer($int64)
 序号，越大越靠前

 StartTime	integer($int64)
 开始时间

 Status	integer($int32)
 状态（1显示，2不显示）

 Surplus	integer($int64)
 剩余数量

 TotalNum	integer($int64)
 总量

 UpdatedAt	integer($int64)
 UseMethod	string
 使用方法
 */
public class GiftBag {
    private int Id;

    private String GiftName;

    private int AppId;

    private long StartTime;

    private long EndTime;

    private String GiftContent;

    private String UseMethod;

    private int TotalNum;

    private int Surplus;

    private int Status;

    private int Order;

    private int DeleteStatus;

    private int CreatedAt;

    private int UpdatedAt;

    public void setId(int Id){
        this.Id = Id;
    }
    public int getId(){
        return this.Id;
    }
    public void setGiftName(String GiftName){
        this.GiftName = GiftName;
    }
    public String getGiftName(){
        return this.GiftName;
    }
    public void setAppId(int AppId){
        this.AppId = AppId;
    }
    public int getAppId(){
        return this.AppId;
    }
    public void setStartTime(long StartTime){
        this.StartTime = StartTime;
    }
    public long getStartTime(){
        return this.StartTime;
    }
    public void setEndTime(long EndTime){
        this.EndTime = EndTime;
    }
    public long getEndTime(){
        return this.EndTime;
    }
    public void setGiftContent(String GiftContent){
        this.GiftContent = GiftContent;
    }
    public String getGiftContent(){
        return this.GiftContent;
    }
    public void setUseMethod(String UseMethod){
        this.UseMethod = UseMethod;
    }
    public String getUseMethod(){
        return this.UseMethod;
    }
    public void setTotalNum(int TotalNum){
        this.TotalNum = TotalNum;
    }
    public int getTotalNum(){
        return this.TotalNum;
    }
    public void setSurplus(int Surplus){
        this.Surplus = Surplus;
    }
    public int getSurplus(){
        return this.Surplus;
    }
    public void setStatus(int Status){
        this.Status = Status;
    }
    public int getStatus(){
        return this.Status;
    }
    public void setOrder(int Order){
        this.Order = Order;
    }
    public int getOrder(){
        return this.Order;
    }
    public void setDeleteStatus(int DeleteStatus){
        this.DeleteStatus = DeleteStatus;
    }
    public int getDeleteStatus(){
        return this.DeleteStatus;
    }
    public void setCreatedAt(int CreatedAt){
        this.CreatedAt = CreatedAt;
    }
    public int getCreatedAt(){
        return this.CreatedAt;
    }
    public void setUpdatedAt(int UpdatedAt){
        this.UpdatedAt = UpdatedAt;
    }
    public int getUpdatedAt(){
        return this.UpdatedAt;
    }




    /**
     * 剩余份数
     * @return
     */
    public String getLastNumText() {
        return String.format(Locale.CHINA, "剩余%d份", Surplus);
    }

    public String getDateText() {
        if(EndTime < 1000_000){
            return "永久";
        }
        return String.format(Locale.CHINA, "%s—%s", TimeUtil.TimeStamp2Date(StartTime, "yyyy/MM/dd"), TimeUtil.TimeStamp2Date(EndTime, "yyyy/MM/dd"));
    }
    public String getDateText2() {
        if(EndTime < 1000_000){
            return "永久";
        }
        return String.format(Locale.CHINA, "%s - %s", TimeUtil.TimeStamp2Date(StartTime, "yyyy.MM.dd"), TimeUtil.TimeStamp2Date(EndTime, "yyyy.MM.dd"));
    }
}
