package com.ym.mec.biz.dal.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Objects;

@ApiModel(value = "训练营详情")
public class TempCampUserTrainingDetailVo implements Serializable {
    @ApiModelProperty(value = "用户id")
    private Integer id;
    @ApiModelProperty(value = "用户名称")
    private String username;
    @ApiModelProperty(value = "手机号")
    private String phone;
    @ApiModelProperty(value = "群组名称")
    private String imGroupName;
    @ApiModelProperty(value = "训练天数")
    private Integer playDay;
    @ApiModelProperty(value = "训练时间")
    private Integer playTime;

    public Integer getId() {
        return id;
    }

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

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getImGroupName() {
        return imGroupName;
    }

    public void setImGroupName(String imGroupName) {
        this.imGroupName = imGroupName;
    }

    public Integer getPlayDay() {
        return playDay;
    }

    public void setPlayDay(Integer playDay) {
        this.playDay = playDay;
    }

    public Integer getPlayTime() {
        return playTime;
    }

    /**
     * 传入秒钟换算成分钟
     */
    public void setPlayTime(Integer playTime) {
        if (Objects.nonNull(playTime)) {
            if (playTime >= 60) {
                BigDecimal divide = BigDecimal.valueOf(playTime).divide(BigDecimal.valueOf(60), 0, RoundingMode.DOWN);
                playTime = divide.intValue();
            } else {
                playTime = 0;
            }
        }
        this.playTime = playTime;
    }
}
