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

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
import com.yonge.cooleshow.biz.dal.enums.MK;
import com.yonge.cooleshow.common.enums.ActivityTypeEnum;
import com.yonge.toolset.base.page.QueryInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @Author: liweifan
 * @Data: 2022-08-04 10:19:49
 */
@ApiModel(value = "ActivityPlanSearch对象", description = "活动计划表查询对象")
public class ActivityPlanSearch extends QueryInfo{
	private static final long serialVersionUID = 1L;
	@ApiModelProperty("活动名称 ")
	private String activityName;
	@ApiModelProperty("客户端：STUDENT 学生端 TEACHER 老师端 ")
	private ClientEnum activityClient;
	@ApiModelProperty(value = "活动类型 EVALUATION 评测活动 STANDARD_GIFT 达标赠送")
	private ActivityTypeEnum activityType;
	@ApiModelProperty("创建状态 0 正式 1 草稿 ")
	private Integer draftFlag;
	@ApiModelProperty("活动状态 0 停用 1 启用 ")
	private Integer activityState;
	@ApiModelProperty(value = "活动开始时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date startTime;
	@ApiModelProperty(value = "活动结束时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date endTime;

	// 活动编号匹配
	@ApiModelProperty("活动ID ")
	private Long activityId;

	public String getActivityName() {
		return activityName;
	}

	public void setActivityName(String activityName) {

		if (StringUtils.isNotEmpty(activityName) && activityName.matches(MK.EXP_INT)) {
			setActivityId(Long.parseLong(activityName));
		}

		this.activityName = activityName;
	}

	public ClientEnum getActivityClient() {
		return activityClient;
	}

	public void setActivityClient(ClientEnum activityClient) {
		this.activityClient = activityClient;
	}

	public ActivityTypeEnum getActivityType() {
		return activityType;
	}

	public void setActivityType(ActivityTypeEnum activityType) {
		this.activityType = activityType;
	}

	public Integer getDraftFlag() {
		return draftFlag;
	}

	public void setDraftFlag(Integer draftFlag) {
		this.draftFlag = draftFlag;
	}

	public Integer getActivityState() {
		return activityState;
	}

	public void setActivityState(Integer activityState) {
		this.activityState = activityState;
	}

	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 Long getActivityId() {
		return activityId;
	}

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