package com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.qqchen.deploy.backend.workflow.annotation.CodeEditorConfig;
import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class DeployNodeLocalVariables extends BaseNodeLocalVariables {


    @SchemaProperty(
        title = "三方Jenkins系统",
        description = "三方Jenkins系统",
        required = true
    )
    private Long externalSystemId;


    @SchemaProperty(
        title = "绑定Jenkins视图",
        description = "Jenkins视图",
        required = true,
        order = 3
    )
    private Long viewId;


    @SchemaProperty(
        title = "绑定Jenkins任务",
        description = "Jenkins任务",
        required = true,
        order = 4
    )
    private Long jobId;

    @SchemaProperty(
        title = "Pipeline script",
        description = "流水线脚本",
        required = true,
        format = "monaco-editor",  // 使用 Monaco Editor
        defaultValue = "#!/bin/bash\n\necho \"Hello World\"",
        codeEditor = @CodeEditorConfig(
            language = "shell",
            theme = "vs-dark",
            minimap = false,
            lineNumbers = true,
            wordWrap = true,
            fontSize = 14,
            tabSize = 2,
            autoComplete = true,
            folding = true
        ),
        order = 6
    )
    private String script;


}
