mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 09:36:00 +08:00
1
This commit is contained in:
@@ -12,7 +12,7 @@ type GroupModel struct {
|
||||
Notification string `gorm:"column:notification;size:255" json:"notification"`
|
||||
Introduction string `gorm:"column:introduction;size:255" json:"introduction"`
|
||||
FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"`
|
||||
CreateTime time.Time `gorm:"column:create_time;index:create_time"`
|
||||
CreateTime time.Time `gorm:"column:create_time;index:create_time;autoCreateTime"`
|
||||
Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"`
|
||||
Status int32 `gorm:"column:status"`
|
||||
CreatorUserID string `gorm:"column:creator_user_id;size:64"`
|
||||
|
||||
@@ -144,6 +144,14 @@ func SliceSetAny[E any, K comparable](es []E, fn func(e E) K) map[K]struct{} {
|
||||
})
|
||||
}
|
||||
|
||||
func Slice[E any, T any](es []E, fn func(e E) T) []T {
|
||||
v := make([]T, len(es))
|
||||
for i := 0; i < len(es); i++ {
|
||||
v = append(v, fn(es[i]))
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
// SliceSet slice to map[E]struct{}
|
||||
func SliceSet[E comparable](es []E) map[E]struct{} {
|
||||
return SliceSetAny(es, func(e E) E {
|
||||
|
||||
Reference in New Issue
Block a user