package com.friday.operation.api.executor.dto.executor;

import com.friday.operation.api.executor.constant.ExecutorState;
import com.friday.operation.api.tooldriver.dto.rpa.RobotDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Author YaoYao
 * @Date Created In 10:47 2023/3/8
 * @Description
 * @Modified By
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ExecutorDto implements Serializable {
    /**
     * 执行器唯一键
     */
    private String key;
    /**
     * 中控租户唯一键
     */
    private String tenantKey;
    /**
     * 机器IP
     */
    private String ip;
    /**
     * 机器用户
     */
    private String user;
    /**
     * 状态{@link ExecutorState}
     */
    private String state;

    public RobotDto transferToRobotDto(){
        return RobotDto.builder()
                .key(this.key)
                .ip(this.ip)
                .userName(this.user)
                .state(this.state)
                .build();
    }
}
