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

com.feingto.cloud.constants.Constants Maven / Gradle / Ivy

There is a newer version: 2.3.5.RELEASE
Show newest version
package com.feingto.cloud.constants;

import com.feingto.cloud.domain.enums.RoleType;

/**
 * 常量
 *
 * @author longfei
 */
public class Constants {
    /**
     * Static resource
     */
    public static final String[] STATIC_RESOURCE = {"/css/**", "/fonts/**", "/js/**", "/favicon.ico"};

    /**
     * HttpScheme
     */
    public static final String HTTP_SCHEME = "http";

    /**
     * Discovery services uri prefix
     */
    public static final String DISCOVERY_SERVICE_PREFIX = "service://";

    /**
     * Debug Header for 调试 and Mock
     */
    public static final String API_DEBUG_HEADER = "Api-Debug";

    /**
     * Debug Header 值调试(大小写不敏感)
     */
    public static final String API_DEBUG_VAL_TEST = "debug";

    /**
     * Request default timeout, unit second
     */
    public static final Integer DEFAULT_REQUEST_TIMEOUT = 60;

    /**
     * Redis cache default timeout, unit second
     */
    public static final Integer DEFAULT_CACHE_TIMEOUT = 60;

    /**
     * OAuth2 异常错误属性描述, 默认值:error_description
     */
    public static final String OAUTH_ERROR_DESC = "message";

    /**
     * 角色权限前缀
     */
    public static final String ROLE_PREFIX = "ROLE_";

    /**
     * 应用权限前缀
     */
    public static final String AUTH_PREFIX = "AUTH_";

    /**
     * 受信应用权限
     */
    public static final String TRUST_CLIENT = "TRUST_CLIENT";

    /**
     * API权限
     */
    public static final String[] API_AUTHORITY = {ROLE_PREFIX + RoleType.ADMIN, AUTH_PREFIX + TRUST_CLIENT};

    /**
     * API版本前缀
     */
    public static final String BASE_API = "/api/v1";

    /**
     * WebSocket前缀
     */
    public static final String BASE_WEB_SOCKET = "/ws";

    /**
     * 开放接口前缀(不认证)
     */
    public static final String BASE_OPEN = "/open";

    /**
     * Feign扫描包
     */
    public static final String BASE_REMOTE_PACKAGES = "com.feingto.cloud.remote";

    /**
     * 监控规则前缀
     */
    public static final String RULE_PREFIX = "rule_";

    /**
     * 监控类别:验证拦截预警
     */
    public static final String MONITOR_CATEGORY_VALIDATE = "validate";

    /**
     * 监控类别:实时监控
     */
    public static final String MONITOR_CATEGORY_REALTIME = "realtime";

    /**
     * 监控类别:定时扫描
     */
    public static final String MONITOR_CATEGORY_QUARTZ = "quartz";

    /**
     * 规则条件:时间范围内(分钟)
     */
    public static final String MONITOR_CONDITION_RATE = "rate";

    /**
     * 规则条件:连续几次超过阈值报警
     */
    public static final String MONITOR_CONDITION_LIMIT = "limit";

    /**
     * 规则条件:跟踪链路
     */
    public static final String MONITOR_CONDITION_TRACE = "trace";

    /**
     * 定时任务名称前缀
     */
    public static final String JOB_NAME_PREFIX = "job_";
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy