package com.qs.mp.admin.domain.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.qs.mp.common.enums.MarketingStatusEnum;
import com.qs.mp.common.utils.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.Objects;

/**
 * 营销活动列表出参类
 * @author Cup
 * @date 2022/5/16
 */
@ApiModel("营销活动列表出参类")
@Data
public class MarketingListVO {

    @ApiModelProperty(value = "活动id,主键")
    private Long id;

    @ApiModelProperty("活动标题")
    private String title;

    @ApiModelProperty("真实人数")
    private Integer realNum;

    @ApiModelProperty("开始时间")
    private Date startTime;

    @ApiModelProperty("结束时间")
    private Date endTime;

    @ApiModelProperty("是否开启: -1关闭,0待开启, 1开启 ")
    private Integer isOn;

    @ApiModelProperty("活动状态-1关闭,0待开启,1开启,2未开始,3进行中,4已结束")
    private String status;

    public String getStatus() {
        return MarketingStatusEnum.getStatus(this.startTime, this.endTime, this.isOn);
    }

}
