2026-06-26 08:37:04 +00:00
|
|
|
package usecase
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
"haixun-backend/internal/model/member/domain/entity"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type RegisterRequest struct {
|
|
|
|
|
TenantID string
|
|
|
|
|
Email string
|
|
|
|
|
Password string
|
|
|
|
|
DisplayName string
|
|
|
|
|
Language string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type LoginRequest struct {
|
|
|
|
|
TenantID string
|
|
|
|
|
Email string
|
|
|
|
|
Password string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type UpdateProfileRequest struct {
|
2026-07-07 14:02:41 +00:00
|
|
|
TenantID string
|
|
|
|
|
UID string
|
|
|
|
|
DisplayName *string
|
|
|
|
|
Avatar *string
|
|
|
|
|
Language *string
|
|
|
|
|
Currency *string
|
|
|
|
|
Phone *string
|
|
|
|
|
EmailVerified *bool
|
|
|
|
|
Status *string
|
|
|
|
|
BusinessEmail *string
|
|
|
|
|
BusinessEmailVerified *bool
|
|
|
|
|
BusinessPhone *string
|
|
|
|
|
BusinessPhoneVerified *bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ListMembersRequest struct {
|
|
|
|
|
TenantID string
|
|
|
|
|
Page int64
|
|
|
|
|
PageSize int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ListMembersResult struct {
|
|
|
|
|
List []*entity.Member
|
|
|
|
|
Total int64
|
|
|
|
|
Page int64
|
|
|
|
|
PageSize int64
|
|
|
|
|
TotalPages int64
|
2026-06-26 08:37:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type AuthToken struct {
|
|
|
|
|
AccessToken string
|
|
|
|
|
RefreshToken string
|
|
|
|
|
ExpiresIn int64
|
|
|
|
|
UID string
|
|
|
|
|
TokenType string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type UseCase interface {
|
|
|
|
|
Register(ctx context.Context, req RegisterRequest) (*entity.Member, *AuthToken, error)
|
|
|
|
|
Login(ctx context.Context, req LoginRequest) (*entity.Member, *AuthToken, error)
|
2026-07-07 14:02:41 +00:00
|
|
|
ListMembers(ctx context.Context, req ListMembersRequest) (*ListMembersResult, error)
|
2026-06-26 08:37:04 +00:00
|
|
|
GetByUID(ctx context.Context, tenantID, uid string) (*entity.Member, error)
|
|
|
|
|
UpdateProfile(ctx context.Context, req UpdateProfileRequest) (*entity.Member, error)
|
2026-07-07 14:02:41 +00:00
|
|
|
UpdatePassword(ctx context.Context, tenantID, uid, password string) error
|
|
|
|
|
SetRoles(ctx context.Context, tenantID, uid string, roles []string) error
|
|
|
|
|
SetEmailVerificationCode(ctx context.Context, tenantID, uid, code string, expiresAt int64) error
|
2026-06-26 08:37:04 +00:00
|
|
|
SetActiveThreadsAccountID(ctx context.Context, tenantID, uid, accountID string) error
|
|
|
|
|
}
|