
package cn.orionsec.ops.handler.sftp.hint;

import cn.orionsec.ops.constant.sftp.SftpTransferType;
import cn.orionsec.ops.entity.domain.FileTransferLogDO;
import lombok.Data;

import java.util.List;

@Data
public class FileTransferHint {

    /**
     * record
     */
    private FileTransferLogDO record;

    /**
     * 类型
     */
    private SftpTransferType type;

    public FileTransferHint(FileTransferLogDO record) {
        this.record = record;
        this.type = SftpTransferType.of(record.getTransferType());
    }

    /**
     * 获取上传配置
     *
     * @param record record
     * @return 上传配置
     */
    public static FileTransferHint transfer(FileTransferLogDO record) {
        return new FileTransferHint(record);
    }

    /**
     * 获取打包配置
     *
     * @param record   record
     * @param fileList fileList
     * @return 上传配置
     */
    public static FilePackageHint packaged(FileTransferLogDO record, List<FileTransferLogDO> fileList) {
        return new FilePackageHint(record, fileList);
    }

}
