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


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 javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 即时通讯群组(ImGroup)表实体类
 *
 * @author zx
 * @since 2022-03-22 10:45:57
 */
@ApiModel(value = "im_group-即时通讯群组")
public class ImGroup implements Serializable {
    @TableId(value = "id_")
    @NotBlank(message = "群编号不可为空")
    @ApiModelProperty(value = "主键;")
    private String id;

    @NotBlank(message = "群名称不能为空")
    @TableField("name_")
    @ApiModelProperty(value = "群名称")
    private String name;

    @TableField("introduce_")
    @ApiModelProperty(value = "群简介")
    private String introduce;

    @TableField("member_num_")
    @ApiModelProperty(value = "群成员数")
    private Integer memberNum;

    @TableField("memo_")
    @ApiModelProperty(value = "群备注")
    private String memo;

    @TableField("img_")
    @ApiModelProperty(value = "群头像")
    private String img;

    @TableField("type_")
    @ApiModelProperty(value = "群类型:FAN粉丝群、COURSE课程群;")
    private ImGroupType type = ImGroupType.FAN;

    @TableField("create_by_")
    @ApiModelProperty(value = "创建人")
    private Long createBy;

    @TableField("auto_pass_flag_")
    @ApiModelProperty(value = "是否自动通过审核")
    private Boolean autoPassFlag = false;

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

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

    public enum ImGroupType implements BaseEnum<String, ImGroupType> {
        FAN("粉丝群"),
        COURSE("课程群");

        private String msg;

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

        public String getMsg() {
            return msg;
        }

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

    public Boolean getAutoPassFlag() {
        return autoPassFlag;
    }

    public void setAutoPassFlag(Boolean autoPassFlag) {
        this.autoPassFlag = autoPassFlag;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public String getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    public Integer getMemberNum() {
        return memberNum;
    }

    public void setMemberNum(Integer memberNum) {
        this.memberNum = memberNum;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public ImGroupType getType() {
        return type;
    }

    public void setType(ImGroupType type) {
        this.type = type;
    }

    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;
    }

}

