33 lines
869 B
Go
33 lines
869 B
Go
package service
|
|
|
|
import (
|
|
"amocrm/internal/models"
|
|
"context"
|
|
"go.uber.org/zap"
|
|
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/model"
|
|
)
|
|
|
|
func (s *Service) GetFieldsWithPagination(ctx context.Context, req *model.PaginationReq, accountID string) (*model.UserListFieldsResp, error) {
|
|
response, err := s.repository.AmoRepo.GetFieldsWithPagination(ctx, req, accountID)
|
|
if err != nil {
|
|
s.logger.Error("error getting fields with pagination", zap.Error(err))
|
|
return nil, err
|
|
}
|
|
return response, nil
|
|
}
|
|
|
|
func (s *Service) UpdateListCustom(ctx context.Context, accountID string) error {
|
|
message := models.KafkaMessage{
|
|
AccountID: accountID,
|
|
Type: models.FieldsUpdate,
|
|
}
|
|
|
|
err := s.ToKafkaUpdate(ctx, message)
|
|
if err != nil {
|
|
s.logger.Error("failed to send message to kafka on service update fields", zap.Error(err))
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|