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

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

/**
 * SSH连接状态响应（Framework层）
 * 
 * 后端发送格式：
 * {
 *   "type": "status",
 *   "data": {
 *     "response": {
 *       "type": "status",
 *       "data": "connected"
 *     }
 *   }
 * }
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SSHStatusResponse extends SSHBaseResponse {
    
    public SSHStatusResponse() {
        setType(SSHMessageType.STATUS);
    }
    
    public SSHStatusResponse(SSHStatusEnum status) {
        this();
        setType(SSHMessageType.STATUS);
        setData(status.name().toLowerCase());
    }
    
    public SSHStatusResponse(String status) {
        this();
        setType(SSHMessageType.STATUS);
        setData(status);
    }
}
