package easydo.technology.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import easydo.technology.base.CommonEntity;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author jinjin
 * @date 2020-09-25
 */
@Setter
@Getter
@TableName("sys_job")
public class Job extends CommonEntity {
    private static final long serialVersionUID = 1L;

    @TableId(value = "job_id", type = IdType.AUTO)
    private Long id;

    @NotBlank
    private String name;

    @NotNull
    private Boolean enabled;

    private Integer jobSort;

    public void copyFrom(Job source) {
        BeanUtils.copyProperties(source, this);
    }
}
