package com.njcn.common.pojo.enums.auth;

import lombok.Getter;

/**
 * @author hongawen
 * @version 1.0.0
 * @date 2022年02月10日 14:50
 */
@Getter
public enum ClientEnum {

    /**
     * 客户端，目前仅分为web端、大屏端、移动端
     */
    WEB_CLIENT("njcn", "web"),
    WEB_CLIENT_TEST("njcntest", "web"),
    SCREEN_CLIENT("screen", "screen"),
    APP_CLIENT("app", "app"),
    WE_CHAT_APP_CLIENT("wx", "app");

    private final String clientId;

    private final String clientType;

    ClientEnum(String clientId, String clientType) {
        this.clientId = clientId;
        this.clientType = clientType;
    }

    public static String getClientType(String clientId) {
        for (ClientEnum item : values()) {
            if (item.getClientId().equals(clientId)) {
                return item.getClientType();
            }
        }
        //默认为web端
        return "web";
    }
}
