package com.xunmei.common.core.domain.edu.dto;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.xunmei.common.core.web.domain.PageRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = true)
public class CoreEduTrainingTaskPageDto extends PageRequest {

    @ApiModelProperty(value = "培训机构")
    private Long orgId;

    @ApiModelProperty(value = "培训机构")
    private String orgPath;

    @ApiModelProperty(value = "学习主题")
    private String title;

    @ApiModelProperty(value = "类型")
    private Integer type;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty("任务时间范围")
    private Date[] range;

    private Date startTime;

    private Date endTime;


    public CoreEduTrainingTaskPageDto() {
        if (ObjectUtil.isNotEmpty(this.range)) {
            this.startTime = DateUtil.beginOfDay(this.range[0]);
            this.endTime = DateUtil.endOfDay(this.range[0]);
        }
    }

}
