sqlx
This commit is contained in:
@@ -25,7 +25,17 @@ func (s *loginLogService) Create(ctx context.Context, req *system.LoginLog) erro
|
||||
}
|
||||
|
||||
func (s *loginLogService) List(ctx context.Context, q dto.SearchDto) ([]*system.LoginLog, int64, error) {
|
||||
return s.repo.List(ctx, q)
|
||||
count, err := s.repo.Count(ctx, q)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
res, err := s.repo.List(ctx, q)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
return res, count, nil
|
||||
}
|
||||
|
||||
func (s *loginLogService) LoginTime(ctx context.Context, email string) (dto.LoginTimeDto, error) {
|
||||
@@ -45,7 +55,9 @@ func (s *loginLogService) LoginTime(ctx context.Context, email string) (dto.Logi
|
||||
}
|
||||
|
||||
func (s *loginLogService) LoginCount(ctx context.Context, email string) int64 {
|
||||
count, err := s.repo.Count(ctx, email)
|
||||
count, err := s.repo.Count(ctx, dto.SearchDto{
|
||||
SearchEmail: email,
|
||||
})
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user