mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-06-17 16:29:21 +08:00
1
This commit is contained in:
parent
7ed60bd8f9
commit
c55785783d
@ -13,6 +13,7 @@ type FriendModel struct {
|
||||
OperatorUserID string `gorm:"column:operator_user_id;size:64"`
|
||||
Ex string `gorm:"column:ex;size:1024"`
|
||||
}
|
||||
|
||||
type ConversationModel struct {
|
||||
OwnerUserID string `gorm:"column:owner_user_id;primary_key;type:char(128)" json:"OwnerUserID"`
|
||||
ConversationID string `gorm:"column:conversation_id;primary_key;type:char(128)" json:"conversationID"`
|
||||
@ -50,6 +51,31 @@ type GroupModel struct {
|
||||
NotificationUserID string `gorm:"column:notification_user_id;size:64"`
|
||||
}
|
||||
|
||||
func (f *GroupModel) EqID(i interface{}) bool {
|
||||
switch v := i.(type) {
|
||||
case GroupModel:
|
||||
return f.GroupID == v.GroupID
|
||||
case *GroupModel:
|
||||
return f.GroupID == v.GroupID
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func DuplicateRemoval[T any](arr []T, fn func(t T) string) {
|
||||
|
||||
}
|
||||
|
||||
func aaa() {
|
||||
DuplicateRemoval([]GroupModel{}, func(t GroupModel) string {
|
||||
return t.GroupID
|
||||
})
|
||||
|
||||
DuplicateRemoval([]*GroupModel{}, func(t *GroupModel) string {
|
||||
return t.GroupID
|
||||
})
|
||||
}
|
||||
|
||||
type FriendRequestModel struct {
|
||||
FromUserID string `gorm:"column:from_user_id;primary_key;size:64"`
|
||||
ToUserID string `gorm:"column:to_user_id;primary_key;size:64"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user