package jnpf.model.cultivate.dto;

import jnpf.model.cultivate.po.FtbCultivateCommonSettingGlobal;
import lombok.Data;

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

/**
 * 培训通用配置 请求对象
 *
 * @author xgl
 * @date 2026/02/11
 */
@Data
public class FtbCultivateCommonSettingGlobalDTO {


    /**
     * 附件规则标识开关(0-关,1-开)
     */
    @NotNull(message = "附件规则标识开关不能为空")
    private Integer attachmentsRule;

    /**
     * 是否开启水印[0-不开启,1-开启]
     */
    @NotNull(message = "水印设置不能为空")
    private Integer watermark;

    /**
     * 是否开启截屏或者录屏的内容将进行白屏处理[0-不开启,1-开启]
     */
    @NotNull(message = "截屏录屏白屏处理设置不能为空")
    private Integer screenshot;

    public FtbCultivateCommonSettingGlobal convert(String userId) {
        FtbCultivateCommonSettingGlobal entity = new FtbCultivateCommonSettingGlobal();
        entity.setId("1");
        entity.setAttachmentsRule(getAttachmentsRule());
        entity.setWatermark(getWatermark());
        entity.setScreenshot(getScreenshot());
        entity.setLastModifyTime(new Date());
        entity.setLastModifyUserId(userId);
        return entity;
    }
}