thread-master/backend/internal/model/member/domain/repository/member.go

35 lines
1.3 KiB
Go
Raw Normal View History

2026-06-26 08:37:04 +00:00
package repository
import (
"context"
"haixun-backend/internal/model/member/domain/entity"
)
type ProfileUpdate struct {
2026-07-07 14:02:41 +00:00
DisplayName *string
Avatar *string
Language *string
Currency *string
Phone *string
EmailVerified *bool
Status *entity.Status
BusinessEmail *string
BusinessEmailVerified *bool
BusinessPhone *string
BusinessPhoneVerified *bool
2026-06-26 08:37:04 +00:00
}
type Repository interface {
EnsureIndexes(ctx context.Context) error
Create(ctx context.Context, member *entity.Member) (*entity.Member, error)
2026-07-07 14:02:41 +00:00
List(ctx context.Context, tenantID string, page, pageSize int64) ([]*entity.Member, int64, int64, int64, error)
2026-06-26 08:37:04 +00:00
FindByUID(ctx context.Context, tenantID, uid string) (*entity.Member, error)
FindByEmail(ctx context.Context, tenantID, email string) (*entity.Member, error)
UpdateProfile(ctx context.Context, tenantID, uid string, update ProfileUpdate) (*entity.Member, error)
SetRoles(ctx context.Context, tenantID, uid string, roles []string) error
SetActiveThreadsAccountID(ctx context.Context, tenantID, uid, accountID string) error
2026-07-07 14:02:41 +00:00
SetEmailVerificationCode(ctx context.Context, tenantID, uid, code string, expiresAt int64) error
UpdatePassword(ctx context.Context, tenantID, uid, passwordHash string) error
2026-06-26 08:37:04 +00:00
}