You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/pkg/common/db/controller/user.go

25 lines
507 B

2 years ago
package controller
import (
"Open_IM/pkg/common/db/mysql"
"context"
)
type UserModel struct {
2 years ago
db *relation.User
}
2 years ago
func NewGroupUser(ctx context.Context) *UserModel {
var userModel UserModel
2 years ago
userModel.db = relation.NewUserDB()
2 years ago
return &userModel
}
2 years ago
func (u *UserModel) Find(ctx context.Context, userIDs []string) (users []*relation.User, err error) {
return u.db.Find(ctx, userIDs)
}
2 years ago
func (u *UserModel) Create(ctx context.Context, users []*relation.User) error {
return u.db.Create(ctx, users)
}