package com.qqchen.deploy.backend.framework.ssh.websocket.request;

import com.qqchen.deploy.backend.framework.enums.SSHMessageType;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * SSH用户输入请求（Framework层）
 * 
 * 前端发送格式：
 * {
 *   "type": "input",
 *   "data": {
 *     "request": {
 *       "type": "input",
 *       "command": "ls -la"
 *     }
 *   }
 * }
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SSHInputRequest extends SSHBaseRequest {
    
    /**
     * 用户输入命令（终端命令或字符）
     */
    private String command;
    
    public SSHInputRequest() {
        setType(SSHMessageType.INPUT);
    }
    
    public SSHInputRequest(String command) {
        this();
        this.command = command;
    }
    
    /**
     * 验证参数有效性
     */
    public boolean isValid() {
        return command != null && !command.isEmpty();
    }
}
