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.
49 lines
2.7 KiB
49 lines
2.7 KiB
1 year ago
|
// Copyright © 2023 OpenIM. All rights reserved.
|
||
|
//
|
||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
// you may not use this file except in compliance with the License.
|
||
|
// You may obtain a copy of the License at
|
||
|
//
|
||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||
|
//
|
||
|
// Unless required by applicable law or agreed to in writing, software
|
||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
// See the License for the specific language governing permissions and
|
||
|
// limitations under the License.
|
||
|
|
||
6 months ago
|
package database
|
||
1 year ago
|
|
||
|
import (
|
||
|
"context"
|
||
6 months ago
|
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/model"
|
||
7 months ago
|
"github.com/openimsdk/protocol/user"
|
||
|
"github.com/openimsdk/tools/db/pagination"
|
||
6 months ago
|
"time"
|
||
1 year ago
|
)
|
||
|
|
||
6 months ago
|
type User interface {
|
||
|
Create(ctx context.Context, users []*model.User) (err error)
|
||
12 months ago
|
UpdateByMap(ctx context.Context, userID string, args map[string]any) (err error)
|
||
6 months ago
|
Find(ctx context.Context, userIDs []string) (users []*model.User, err error)
|
||
|
Take(ctx context.Context, userID string) (user *model.User, err error)
|
||
|
TakeNotification(ctx context.Context, level int64) (user []*model.User, err error)
|
||
|
TakeByNickname(ctx context.Context, nickname string) (user []*model.User, err error)
|
||
|
Page(ctx context.Context, pagination pagination.Pagination) (count int64, users []*model.User, err error)
|
||
|
PageFindUser(ctx context.Context, level1 int64, level2 int64, pagination pagination.Pagination) (count int64, users []*model.User, err error)
|
||
|
PageFindUserWithKeyword(ctx context.Context, level1 int64, level2 int64, userID, nickName string, pagination pagination.Pagination) (count int64, users []*model.User, err error)
|
||
12 months ago
|
Exist(ctx context.Context, userID string) (exist bool, err error)
|
||
|
GetAllUserID(ctx context.Context, pagination pagination.Pagination) (count int64, userIDs []string, err error)
|
||
1 year ago
|
GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) (opt int, err error)
|
||
9 months ago
|
// Get user total quantity
|
||
1 year ago
|
CountTotal(ctx context.Context, before *time.Time) (count int64, err error)
|
||
9 months ago
|
// Get user total quantity every day
|
||
1 year ago
|
CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error)
|
||
7 months ago
|
// CRUD user command
|
||
10 months ago
|
AddUserCommand(ctx context.Context, userID string, Type int32, UUID string, value string, ex string) error
|
||
11 months ago
|
DeleteUserCommand(ctx context.Context, userID string, Type int32, UUID string) error
|
||
10 months ago
|
UpdateUserCommand(ctx context.Context, userID string, Type int32, UUID string, val map[string]any) error
|
||
11 months ago
|
GetUserCommand(ctx context.Context, userID string, Type int32) ([]*user.CommandInfoResp, error)
|
||
10 months ago
|
GetAllUserCommand(ctx context.Context, userID string) ([]*user.AllCommandInfoResp, error)
|
||
1 year ago
|
}
|