package com.xinelu.manage.domain.trainingitemwatchrecord;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalTime;

/**
 * 学习培训项目观看时间点记录对象 training_item_watch_record
 *
 * @author xinyilu
 * @date 2023-04-20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "学习培训项目观看时间点记录对象", description = "training_item_watch_record")
public class TrainingItemWatchRecord extends BaseDomain implements Serializable {
    private static final long serialVersionUID = 1519467029465893375L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 学习培训订单id
     */
    @ApiModelProperty(value = "学习培训订单id")
    @Excel(name = "学习培训订单id")
    @NotNull(message = "学习培训订单id不能为空", groups = {Insert.class, Update.class})
    private Long trainingOrderId;

    /**
     * 培训项目表id，此处id是学习培训订单明细表中的项目id
     */
    @ApiModelProperty(value = "培训项目表id，此处id是学习培训订单明细表中的项目id")
    @Excel(name = "培训项目表id，此处id是学习培训订单明细表中的项目id")
    @NotNull(message = "培训项目表id不能为空", groups = {Insert.class, Update.class})
    private Long trainingItemId;

    /**
     * 培训项目标题
     */
    @ApiModelProperty(value = "培训项目标题")
    @Excel(name = "培训项目标题")
    private String trainingItemTitle;

    /**
     * 培训项目章节表id，此处id是学习培训订单章节信息表中的id
     */
    @ApiModelProperty(value = "培训项目章节表id，此处id是学习培训订单章节信息表中的id")
    @Excel(name = "培训项目章节表id，此处id是学习培训订单章节信息表中的id")
    @NotNull(message = "培训项目章节表id不能为空", groups = {Insert.class, Update.class})
    private Long trainingItemDirectoryId;

    /**
     * 培训项目章节名称
     */
    @ApiModelProperty(value = "培训项目章节名称")
    @Excel(name = "培训项目章节名称")
    private String trainingItemDirectoryName;

    /**
     * 护理员表id
     */
    @ApiModelProperty(value = "护理员表id")
    @Excel(name = "护理员表id")
    @NotNull(message = "护理员表id不能为空", groups = {Insert.class, Update.class})
    private Long nurseStationPersonId;

    /**
     * 护理站人员名称
     */
    @ApiModelProperty(value = "护理站人员名称")
    @Excel(name = "护理站人员名称")
    private String nursePersonName;

    /**
     * 观看日期，格式：yyyy-MM-dd
     */
    @ApiModelProperty(value = "观看日期，格式：yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "观看日期，格式：yyyy-MM-dd", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDate watchDate;

    /**
     * 培训项目观看时间点，格式：HH:mm:ss，视频学习类型使用
     */
    @ApiModelProperty(value = "培训项目观看时间点，格式：HH:mm:ss，视频学习类型使用")
    @JsonFormat(pattern = "HH:mm:ss")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @Excel(name = "培训项目观看时间点，格式：HH:mm:ss，视频学习类型使用", width = 30, dateFormat = "HH:mm:ss")
    private LocalTime watchTime;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("trainingOrderId", getTrainingOrderId())
                .append("trainingItemId", getTrainingItemId())
                .append("trainingItemTitle", getTrainingItemTitle())
                .append("trainingItemDirectoryId", getTrainingItemDirectoryId())
                .append("trainingItemDirectoryName", getTrainingItemDirectoryName())
                .append("nurseStationPersonId", getNurseStationPersonId())
                .append("nursePersonName", getNursePersonName())
                .append("watchDate", getWatchDate())
                .append("watchTime", getWatchTime())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
