// Package entity holds group domain types. Persistence belongs in model. package entity const ( StatusActive = 1 StatusDissolved = 2 MaxNameLen = 32 MaxMembers = 200 ListDefault = 20 ListMax = 100 MemberListMax = 200 MaxCollageFaces = 9 ) // Group is a type-2 chat. ID is the AUTO_INCREMENT 群号; ConversationID is Snowflake. type Group struct { ID int64 ConversationID int64 Name string Avatar string OwnerID int64 MutedAll bool MemberCount int Status int CreatedAtMS int64 UpdatedAtMS int64 } func (g *Group) Active() bool { return g != nil && g.Status == StatusActive } func ClampLimit(limit int) int { if limit <= 0 { return ListDefault } if limit > ListMax { return ListMax } return limit } func ClampMemberLimit(limit int) int { if limit <= 0 { return MemberListMax } if limit > MemberListMax { return MemberListMax } return limit }