package com.njzscloud.common.security.contant;

import com.njzscloud.common.core.utils.Key;
import com.njzscloud.common.security.support.UserDetail;

/**
 * 常量
 */
public final class Constants {
    // 随机码字符串池
    public static final String RANDOM_BASE_STRING = "23456789abcdefjhjkmnpqrstuvwxyzABCDEFJHJKMNPQRSTUVWXYZ";

    public static final String ROLE_AUTHENTICATED = "ROLE_AUTHENTICATED";
    public static final String ROLE_ANONYMOUS = "ROLE_ANONYMOUS";
    public static final String ROLE_ADMIN = "ROLE_ADMIN";
    public static final String ROLE_NONE = "ROLE_NONE";

    // Redis 订阅频道  权限更新
    public static final String REDIS_TOPIC_PERMISSION_UPDATE = "permission_update";

    public static final Key TOKEN_CACHE_KEY = Key.create("token:{userId}:{tid}");
    public static final String TOKEN_STR_SEPARATOR = ",";
    public static final String LOGIN_URL = "/auth/login";
    public static final String LOGIN_CODE_URL = "/auth/login_code";
    public static final String LOGIN_WECHAT_URL = "/auth/login_wechat";
    public static final String LOGOUT_URL = "/auth/logout";

    /**
     * 匿名用户
     */
    public static final UserDetail ANONYMOUS_USER = UserDetail.anonymousUser();
}
