This commit is contained in:
2025-09-28 20:19:45 +03:00
parent 6638ef1b5f
commit 3fd63d5f32
21 changed files with 356 additions and 355 deletions

View File

@@ -2,13 +2,15 @@ package ozon
import (
"errors"
"git.denco.store/fakz9/ozon-api-client/ozon"
"github.com/tidwall/gjson"
"net/http"
"sipro-mps/internal/marketplace"
"git.denco.store/fakz9/ozon-api-client/ozon"
"github.com/redis/rueidis"
"github.com/tidwall/gjson"
)
func GetClientFromMarketplace(mp *marketplace.Marketplace) (*ozon.Client, error) {
func GetClientFromMarketplace(redis rueidis.Client, mp *marketplace.Marketplace) (*ozon.Client, error) {
authDataParsed := gjson.Parse(mp.AuthData)
clientIdResult := authDataParsed.Get("clientId")
@@ -19,7 +21,7 @@ func GetClientFromMarketplace(mp *marketplace.Marketplace) (*ozon.Client, error)
apiKey := apiKeyResult.String()
clientId := clientIdResult.String()
httpClient := &http.Client{
Transport: NewRateLimitTransport(),
Transport: NewRateLimitTransport(redis),
}
opts := []ozon.ClientOption{
ozon.WithAPIKey(apiKey),