package com.yonge.cooleshow.biz.dal.enums.im;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.yonge.toolset.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 群成员角色
 */
@Getter
public enum EImGroupMemberRoleType implements BaseEnum<String, EImGroupMemberRoleType> {

    Owner("群主"),
    Admin("管理员"),
    Member("普通成员"),
    ;

    @EnumValue
    private final String code;

    private final String msg;

    EImGroupMemberRoleType(String msg) {
        this.msg = msg;

        this.code = this.name();
    }

    public static EImGroupMemberRoleType fromClientType(String clientType) {
        switch (clientType) {
            case "TEACHER":
                return Admin;
            case "STUDENT":
            default:
                return Member;
        }
    }
}
