2024-04-29 19:35:18 +08:00
|
|
|
package repository
|
|
|
|
|
2024-09-29 21:12:57 +08:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"mylomen_server/common/dto"
|
|
|
|
)
|
2024-04-29 19:35:18 +08:00
|
|
|
|
|
|
|
type gUserRepository interface {
|
2024-09-29 21:12:57 +08:00
|
|
|
FindByReq(ctx context.Context, req dto.LoginReq) *UserDO
|
|
|
|
|
2024-09-30 22:49:21 +08:00
|
|
|
//FindById 根据 id 查询用户
|
2024-09-29 20:14:50 +08:00
|
|
|
FindById(ctx context.Context, id int64) *UserDO
|
2024-09-30 22:49:21 +08:00
|
|
|
FindBySn(ctx context.Context, sn string) *UserDO
|
|
|
|
|
2024-04-29 19:35:18 +08:00
|
|
|
//FindByAccount 根据 account 查询用户
|
2024-09-29 20:14:50 +08:00
|
|
|
FindByAccount(ctx context.Context, account string) *UserDO
|
|
|
|
FindByEmail(ctx context.Context, email string) *UserDO
|
|
|
|
FindByPhone(ctx context.Context, phone string) *UserDO
|
|
|
|
FindByWxId(ctx context.Context, wxId string) *UserDO
|
|
|
|
FindByQqId(ctx context.Context, qqId string) *UserDO
|
|
|
|
FindByGoogleId(ctx context.Context, googleId string) *UserDO
|
|
|
|
FindByFacebookId(ctx context.Context, facebookId string) *UserDO
|
2024-04-29 19:35:18 +08:00
|
|
|
|
|
|
|
//Create 创建用户
|
2024-09-29 20:14:50 +08:00
|
|
|
Create(ctx context.Context, data *UserDO) error
|
2024-04-29 19:35:18 +08:00
|
|
|
|
|
|
|
//UpdateById 根据ID更新用户
|
2024-09-29 20:14:50 +08:00
|
|
|
UpdateById(ctx context.Context, data *UserDO) error
|
2024-04-29 19:35:18 +08:00
|
|
|
}
|
|
|
|
|
2024-09-30 22:49:21 +08:00
|
|
|
var GUser gUserRepository = new(userRepositoryImpl)
|