package com.yonge.cooleshow.biz.dal.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yonge.toolset.base.enums.BaseEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;

/**
 * 群成员表(ImGroupMember)表实体类
 *
 * @author zx
 * @since 2022-03-22 10:45:58
 */
@ApiModel(value = "im_group_member-群成员表")
public class ImGroupMember implements Serializable {
    @TableId(value = "id_", type = IdType.AUTO)
    @ApiModelProperty(value = "主键;")
    private Long id;

    @TableField("group_id_")
    @ApiModelProperty(value = "群编号;")
    private String groupId;

    @TableField("user_id_")
    @ApiModelProperty(value = "用户编号;")
    private Long userId;

    @TableField("nickname_")
    @ApiModelProperty(value = "昵称;")
    private String nickname;

    @TableField("avatar_")
    @ApiModelProperty(value = "用户头像;")
    private String avatar;

    @TableField("is_admin_")
    @ApiModelProperty(value = "是否是管理员")
    private Boolean isAdmin;

    @TableField("role_type_")
    @ApiModelProperty(value = "群角色TEACHER老师、STUDENT学生")
    private ImGroupMemberRoleType roleType;

    @TableField("create_time_")
    @ApiModelProperty(value = "创建时间;")
    private Date createTime;

    @TableField("update_time_")
    @ApiModelProperty(value = "修改时间;")
    private Date updateTime;

    public ImGroupMember() {
    }

    public ImGroupMember(String groupId, Long userId, String nickname, String avatar, Boolean isAdmin, ImGroupMemberRoleType roleType) {
        this.groupId = groupId;
        this.userId = userId;
        this.avatar = avatar;
        this.nickname = nickname;
        this.isAdmin = isAdmin;
        this.roleType = roleType;
    }

    public enum ImGroupMemberRoleType implements BaseEnum<String, ImGroupMemberRoleType> {
        TEACHER("老师"),
        STUDENT("学生");

        private String msg;

        ImGroupMemberRoleType(String msg) {
            this.msg = msg;
        }

        public String getMsg() {
            return msg;
        }

        @Override
        public String getCode() {
            return super.name();
        }
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Boolean getIsAdmin() {
        return isAdmin;
    }

    public void setIsAdmin(Boolean isAdmin) {
        this.isAdmin = isAdmin;
    }

    public ImGroupMemberRoleType getRoleType() {
        return roleType;
    }

    public void setRoleType(ImGroupMemberRoleType roleType) {
        this.roleType = roleType;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

}

