package com.docus.server.archivefile.convert;

import com.docus.server.entity.TaskMessage;
import com.docus.server.entity.TaskMessageRetryLog;
import org.mapstruct.Mapper;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

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

    @Mappings({})
    TaskMessageRetryLog convert(TaskMessage taskMessage);

    default TaskMessageRetryLog toConvertRetryLog(TaskMessage message, Long id) {
        TaskMessageRetryLog taskMessageRetryLog = convert(message);
        taskMessageRetryLog.setId(id);
        taskMessageRetryLog.setMessageId(message.getId());
        return taskMessageRetryLog;
    }

}
