package cn.axzo.workflow.server.common.annotation;

import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Controller Error Send to DingTalk
 */
@Inherited
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ErrorReporter {
    /**
     * 用于发钉钉通知的标题
     *
     * @return
     */
    @AliasFor("title")
    String value() default "";

    @AliasFor("value")
    String title() default "";

    EnvConfig[] envConfig() default {
            @EnvConfig(profiles = {"local"}, type = ReporterType.ONLY_LOG),
            @EnvConfig(profiles = {"dev", "test", "pre"}, type = ReporterType.BOTH),
            @EnvConfig(profiles = {"live", "master"}, type = ReporterType.ONLY_LOG)
    };
}
