<?php

namespace app\common\enum;


/**
 * 管理后台登录终端
 * Class terminalEnum
 * @package app\common\enum
 */
class AdminTerminalEnum
{
    const PC = 1;
    const MOBILE = 2;

    const PLATFORM = '__saas__platform__';
    const TENANT = '__saas__tenant__';
    const USER = '__saas__user__';
    const Worker = '__saas__worker__';

    /**
     * @notes 是否为租户端
     * @return bool
     * @author JXDN
     * @date 2024/09/04 16:44
     */
    public static function isTenant()
    {
        return request()->source === self::TENANT;
    }

    /**
     * @notes 是否为平台端
     * @return bool
     * @author JXDN
     * @date 2024/09/04 16:44
     */
    public static function isPlatform()
    {
        return request()->source === self::PLATFORM;
    }

    /**
     * @notes 是否为用户端
     * @return bool
     * @author JXDN
     * @date 2024/09/04 16:44
     */
    public static function isUser()
    {
        return request()->source === self::USER;
    }

    /**
     * @notes 是否为工程师端
     * @return bool
     * @author JXDN
     * @date 2024/09/04 16:44
     */
    public static function isWorker()
    {
        return request()->source === self::Worker;
    }
}