add service
All checks were successful
Deploy Smart Search Backend / deploy (push) Successful in 1m47s
All checks were successful
Deploy Smart Search Backend / deploy (push) Successful in 1m47s
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"git.techease.ru/Smart-search/smart-search-back/internal/repository"
|
||||
"git.techease.ru/Smart-search/smart-search-back/pkg/errors"
|
||||
"git.techease.ru/Smart-search/smart-search-back/pkg/fileparser"
|
||||
"git.techease.ru/Smart-search/smart-search-back/pkg/validation"
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgx/v5"
|
||||
)
|
||||
@@ -45,6 +46,14 @@ func NewRequestService(
|
||||
}
|
||||
|
||||
func (s *requestService) CreateTZ(ctx context.Context, userID int, requestTxt string, fileData []byte, fileName string) (uuid.UUID, string, error) {
|
||||
if err := validation.ValidateRequestTxt(requestTxt); err != nil {
|
||||
return uuid.Nil, "", err
|
||||
}
|
||||
|
||||
if err := validation.ValidateFileSize(len(fileData)); err != nil {
|
||||
return uuid.Nil, "", err
|
||||
}
|
||||
|
||||
combinedText := requestTxt
|
||||
|
||||
if len(fileData) > 0 && fileName != "" {
|
||||
|
||||
Reference in New Issue
Block a user