This commit is contained in:
@@ -25,7 +25,7 @@ type UserService interface {
|
||||
|
||||
type InviteService interface {
|
||||
Generate(ctx context.Context, userID, maxUses, ttlDays int) (*model.InviteCode, error)
|
||||
GetInfo(ctx context.Context, code int64) (*model.InviteCode, error)
|
||||
GetInfo(ctx context.Context, userID int) (*model.InviteCode, error)
|
||||
}
|
||||
|
||||
type RequestService interface {
|
||||
|
||||
@@ -63,6 +63,6 @@ func (s *inviteService) Generate(ctx context.Context, userID, maxUses, ttlDays i
|
||||
return invite, nil
|
||||
}
|
||||
|
||||
func (s *inviteService) GetInfo(ctx context.Context, code int64) (*model.InviteCode, error) {
|
||||
return s.inviteRepo.FindByCode(ctx, code)
|
||||
func (s *inviteService) GetInfo(ctx context.Context, userID int) (*model.InviteCode, error) {
|
||||
return s.inviteRepo.FindActiveByUserID(ctx, userID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user