|
|
|
@ -40,6 +40,8 @@ type UserDatabase interface {
|
|
|
|
|
Find(ctx context.Context, userIDs []string) (users []*relation.UserModel, err error)
|
|
|
|
|
// Find userInfo By Nickname
|
|
|
|
|
FindByNickname(ctx context.Context, nickname string) (users []*relation.UserModel, err error)
|
|
|
|
|
// Find notificationAccounts
|
|
|
|
|
FindNotification(ctx context.Context, level string) (users []*relation.UserModel, err error)
|
|
|
|
|
// Create Insert multiple external guarantees that the userID is not repeated and does not exist in the db
|
|
|
|
|
Create(ctx context.Context, users []*relation.UserModel) (err error)
|
|
|
|
|
// Update update (non-zero value) external guarantee userID exists
|
|
|
|
@ -140,6 +142,11 @@ func (u *userDatabase) FindByNickname(ctx context.Context, nickname string) (use
|
|
|
|
|
return u.userDB.TakeByNickname(ctx, nickname)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Find notificationAccouts
|
|
|
|
|
func (u *userDatabase) FindNotification(ctx context.Context, level string) (users []*relation.UserModel, err error) {
|
|
|
|
|
return u.userDB.TakeNotification(ctx, level)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Create Insert multiple external guarantees that the userID is not repeated and does not exist in the db.
|
|
|
|
|
func (u *userDatabase) Create(ctx context.Context, users []*relation.UserModel) (err error) {
|
|
|
|
|
return u.tx.Transaction(ctx, func(ctx context.Context) error {
|
|
|
|
|