package com.docus.server.archivefile.convert;

import com.docus.server.entity.TaskConfig;
import com.docus.server.entity.TaskConfigRetryLog;
import org.mapstruct.Mapper;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

@Mapper
public interface TaskConfigRetryLogConvert {
    TaskConfigRetryLogConvert INSTANCE = Mappers.getMapper(TaskConfigRetryLogConvert.class);

    @Mappings({})
    TaskConfigRetryLog convert(TaskConfig taskConfig);

    default TaskConfigRetryLog toConvertRetryLog(TaskConfig taskConfig, Long id) {
        TaskConfigRetryLog taskConfigRetryLog = convert(taskConfig);
        taskConfigRetryLog.setId(id);
        taskConfigRetryLog.setMessageId(taskConfig.getId());
        return taskConfigRetryLog;
    }

}
