package org.nl.acs.instruction.domain;

import org.nl.acs.instruction.service.dto.InstructionDto;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;

import java.io.Serializable;

/**
 * @author jiaolm
 * @date 2023-05-09
 */
@Data
@Builder
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("acs_instruction")
public class Instruction extends InstructionDto implements Serializable {
    private static final long serialVersionUID = 1L;

    public Instruction() {
    }

    public Instruction(InstructionDto instructionDto) {
        BeanUtil.copyProperties(instructionDto,this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public void copyFrom(Instruction source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
