refactoring. put methods to individual structures

This commit is contained in:
diPhantxm
2023-03-15 21:38:17 +03:00
parent 2e60a17c56
commit 2566f85da3
17 changed files with 148 additions and 55 deletions

View File

@@ -7,6 +7,10 @@ import (
core "github.com/diphantxm/ozon-api-client"
)
type Rating struct {
client *core.Client
}
type GetCurrentSellerRatingInfoResponse struct {
core.CommonResponse
@@ -80,7 +84,7 @@ type GetCurrentSellerRatingInfoResponse struct {
} `json:"groups"`
}
func (c Client) GetCurrentSellerRatingInfo() (*GetCurrentSellerRatingInfoResponse, error) {
func (c Rating) GetCurrentSellerRatingInfo() (*GetCurrentSellerRatingInfoResponse, error) {
url := "/v1/rating/summary"
resp := &GetCurrentSellerRatingInfoResponse{}
@@ -169,7 +173,7 @@ type GetSellerRatingInfoPeriodResponse struct {
} `json:"ratings"`
}
func (c Client) GetSellerRatingInfoForPeriod(params *GetSellerRatingInfoForPeriodParams) (*GetSellerRatingInfoPeriodResponse, error) {
func (c Rating) GetSellerRatingInfoForPeriod(params *GetSellerRatingInfoForPeriodParams) (*GetSellerRatingInfoPeriodResponse, error) {
url := "/v1/rating/history"
resp := &GetSellerRatingInfoPeriodResponse{}