package com.yonge.cooleshow.biz.dal.dto.search;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yonge.cooleshow.common.enums.EStatus;
import com.yonge.toolset.base.page.QueryInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.Optional;

/**
 * @Author: liweifan
 * @Data: 2022-08-04 10:19:49
 */
@ApiModel(value = "ActivityUserRewardSearch对象", description = "活动用户获奖表查询对象")
public class ActivityUserRewardSearch extends QueryInfo{
	private static final long serialVersionUID = 1L;


	@ApiModelProperty("活动id")
	@NotNull(message = "活动id不能为空")
	private Long activityId;


	@ApiModelProperty("真实姓名/编号/手机号")
	private String search;

	@ApiModelProperty("奖品id")
	private Long  activityRewardId;

	@ApiModelProperty("开始时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date startTime;

	@ApiModelProperty("结束时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date endTime;

	@ApiModelProperty(hidden = true)
	private Integer activityGroupBy;

	public Long getActivityId() {
		return activityId;
	}

	public void setActivityId(Long activityId) {
		this.activityId = activityId;
	}

	@Override
	public String getSearch() {
		return search;
	}

	@Override
	public void setSearch(String search) {
		this.search = search;
	}

	public Long getActivityRewardId() {
		return activityRewardId;
	}

	public void setActivityRewardId(Long activityRewardId) {
		this.activityRewardId = activityRewardId;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public Integer getActivityGroupBy() {
		return Optional.ofNullable(activityGroupBy).orElse(EStatus.ENABLE.getValue());
	}

	public void setActivityGroupBy(Integer activityGroupBy) {
		this.activityGroupBy = activityGroupBy;
	}
}