new endpoint to return product list

This commit is contained in:
Daniel Goc
2026-03-18 11:39:18 +01:00
parent a0dcb56fda
commit 6cebcacb5d
23 changed files with 1243 additions and 66 deletions

View File

@@ -19,7 +19,7 @@ import (
"git.ma-al.com/goc_daniel/b2b/app/model"
"git.ma-al.com/goc_daniel/b2b/app/service/langsService"
"git.ma-al.com/goc_daniel/b2b/app/utils/responseErrors"
ProductDescriptionRepo "git.ma-al.com/goc_daniel/b2b/repository/productDescriptionRepo"
"git.ma-al.com/goc_daniel/b2b/repository/productDescriptionRepo"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option"
"github.com/openai/openai-go/v3/responses"
@@ -27,7 +27,7 @@ import (
)
type ProductDescriptionService struct {
productDescriptionRepo ProductDescriptionRepo.ProductDescriptionRepo
productDescriptionRepo productDescriptionRepo.UIProductDescriptionRepo
ctx context.Context
googleCli translate.TranslationClient
projectID string
@@ -74,10 +74,11 @@ func New() *ProductDescriptionService {
option.WithHTTPClient(&http.Client{Timeout: 300 * time.Second})) // five minutes timeout
return &ProductDescriptionService{
ctx: ctx,
openAIClient: openAIClient,
googleCli: *googleCli,
projectID: cfg.GoogleTranslate.ProjectID,
productDescriptionRepo: productDescriptionRepo.New(),
ctx: ctx,
openAIClient: openAIClient,
googleCli: *googleCli,
projectID: cfg.GoogleTranslate.ProjectID,
}
}