package model

// MemberRole 表示群成员角色的枚举
type MemberRole string

const (
	MemberRoleOwner  MemberRole = "owner"
	MemberRoleAdmin  MemberRole = "admin"
	MemberRoleMember MemberRole = "member"
)

// GroupMember 表示微信群成员
type GroupMember struct {
	BaseModel
	GroupID  uint       `gorm:"column:group_id;index" json:"group_id"`                                  // 关联到Contact表中的群组ID
	WechatID string     `gorm:"column:wechat_id;index:idx_member_wechat_id,length:64" json:"wechat_id"` // 添加索引长度
	Nickname string     `gorm:"column:nickname" json:"nickname"`
	Avatar   string     `gorm:"column:avatar" json:"avatar"`
	Role     MemberRole `gorm:"column:role;default:'member'" json:"role"`
}

// TableName 指定表名
func (GroupMember) TableName() string {
	return "group_members"
}
