All Downloads are FREE. Search and download functionalities are using the official Maven repository.

club.zhcs.lina.starter.apm.APMConfigurationProerties Maven / Gradle / Ivy

package club.zhcs.lina.starter.apm;

import org.springframework.boot.context.properties.ConfigurationProperties;

import club.zhcs.lina.starter.WechatWork;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

/**
 * @author Kerbores([email protected])
 *
 */
@Data
@ConfigurationProperties("lina.apm")
public class APMConfigurationProerties {

    /**
     * 是否开启apm
     */
    private boolean enabled = true;

    /**
     * 切面配置
     */
    private Pointcut pointcut = new Pointcut();

    /**
     * 监听器设置
     */
    private Listener listener = new Listener();

    @Data
    public static class Pointcut {

        /**
         * 切面模式
         */
        Mode mode = Mode.REST_CONTROLLER;
        /**
         * 切面表達式
         */
        String execution;

        @Getter
        @AllArgsConstructor
        public enum Mode {
            /**
             * 全局模式
             */
            REST_CONTROLLER("@within(org.springframework.web.bind.annotation.RestController)"),
            /**
             * 指定模型
             */
            APM("@within(club.zhcs.lina.apm.APM) || @annotation(club.zhcs.lina.apm.APM)"),
            /**
             * 自定义
             */
            CUSTOMER("");

            String execution;
        }
    }

    @Data
    public static class Listener {

        /**
         * 企业微信
         */
        WechatWork wechat = new WechatWork();

        /**
         * 开启默认基于日志记录
         */
        boolean defaultLogEnabled = true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy