feat: shit shit
This commit is contained in:
@@ -15,4 +15,5 @@ type Marketplace struct {
|
||||
AuthData pgtype.Text
|
||||
WarehouseID pgtype.Text
|
||||
AuthDataJson []byte
|
||||
CampaignID pgtype.Text
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
const getMarketplaceByID = `-- name: GetMarketplaceByID :one
|
||||
SELECT id, base_marketplace, name, auth_data, warehouse_id, auth_data_json FROM marketplaces
|
||||
SELECT id, base_marketplace, name, auth_data, warehouse_id, auth_data_json, campaign_id FROM marketplaces
|
||||
WHERE id = $1 LIMIT 1
|
||||
`
|
||||
|
||||
@@ -24,6 +24,7 @@ func (q *Queries) GetMarketplaceByID(ctx context.Context, id int32) (Marketplace
|
||||
&i.AuthData,
|
||||
&i.WarehouseID,
|
||||
&i.AuthDataJson,
|
||||
&i.CampaignID,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
@@ -10,5 +10,6 @@ create table marketplaces
|
||||
CASE
|
||||
WHEN ((auth_data)::text IS JSON) THEN (auth_data)::jsonb
|
||||
ELSE NULL::jsonb
|
||||
END) stored
|
||||
END) stored,
|
||||
campaign_id varchar
|
||||
);
|
||||
@@ -2,8 +2,9 @@ package marketplace
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/go-faster/errors"
|
||||
"sipro-mps/pkg/utils"
|
||||
|
||||
"github.com/go-faster/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -18,6 +19,7 @@ type Marketplace struct {
|
||||
AuthData string `json:"auth_data"`
|
||||
WarehouseID string `json:"warehouse_id"`
|
||||
AuthDataJson []byte `json:"auth_data_json,omitempty"`
|
||||
CampaignID string `json:"campaign_id,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Marketplace) getIdentifierWildberries() (string, error) {
|
||||
|
||||
@@ -25,5 +25,6 @@ func (r *dbRepository) GetMarketplaceByID(ctx context.Context, id int) (*Marketp
|
||||
AuthData: marketplace.AuthData.String,
|
||||
WarehouseID: marketplace.WarehouseID.String,
|
||||
AuthDataJson: marketplace.AuthDataJson,
|
||||
CampaignID: marketplace.CampaignID.String,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user