package com.qqchen.deploy.backend.workflow.annotation;

import com.qqchen.deploy.backend.workflow.enums.CompareOperatorEnums;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Schema属性的可见性条件配置
 * 
 * <p>使用示例：
 * <pre>
 * {@code
 * @SchemaProperty(
 *     title = "Jenkins任务",
 *     visibleOn = @SchemaPropertyVisibleOn(
 *         field = "buildType",
 *         value = "JENKINS"
 *     )
 * )
 * private String jenkinsJob;
 * 
 * @SchemaProperty(
 *     title = "共享配置",
 *     visibleOn = {
 *         @SchemaPropertyVisibleOn(
 *             field = "buildType",
 *             value = {"JENKINS", "NATIVE"},
 *             operator = CompareOperator.IN
 *         )
 *     }
 * )
 * private String sharedConfig;
 * }
 * </pre>
 */
@Target({})
@Retention(RetentionPolicy.RUNTIME)
public @interface SchemaPropertyVisibleOn {
    /**
     * 依赖的字段名
     */
    String field() default "";

    /**
     * 字段值
     * 支持单个值或多个值
     */
    String[] value() default {};

    /**
     * 比较操作符
     */
    CompareOperatorEnums operator() default CompareOperatorEnums.EQUAL;
} 