Skip to content

Commit

Permalink
fix: remove StoreSticker, use BaseSticker
Browse files Browse the repository at this point in the history
  • Loading branch information
SevereCloud committed Jan 11, 2022
1 parent 4cc2e6c commit 6c49ab4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
6 changes: 3 additions & 3 deletions api/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func (vk *VK) StoreDeactivateProduct(params Params) (response int, err error) {

// StoreGetFavoriteStickersResponse struct.
type StoreGetFavoriteStickersResponse struct {
Count int `json:"count"`
Items []object.StoreSticker `json:"items"`
Count int `json:"count"`
Items []object.BaseSticker `json:"items"`
}

// StoreGetFavoriteStickers method.
Expand Down Expand Up @@ -109,7 +109,7 @@ func (vk *VK) StoreGetProductsExtended(params Params) (response StoreGetProducts
}

// StoreGetStickersResponse struct.
type StoreGetStickersResponse []object.StoreSticker
type StoreGetStickersResponse []object.BaseSticker

// StoreGetStickers method.
//
Expand Down
6 changes: 3 additions & 3 deletions object/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ type BaseRepostsInfo struct {
type BaseSticker struct {
Images []BaseImage `json:"images"`
ImagesWithBackground []BaseImage `json:"images_with_background"`
ProductID int `json:"product_id"`
ProductID int `json:"product_id,omitempty"`
StickerID int `json:"sticker_id"`
IsAllowed bool `json:"is_allowed"`
AnimationURL string `json:"animation_url"`
IsAllowed BaseBoolInt `json:"is_allowed,omitempty"`
AnimationURL string `json:"animation_url,omitempty"`
}

// MaxSize return the largest BaseSticker.
Expand Down
19 changes: 5 additions & 14 deletions object/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,9 @@ type StoreProduct struct {
// StoreProductExtended struct.
type StoreProductExtended struct {
StoreProduct
Title string `json:"title"`
Stickers []StoreSticker `json:"stickers"`
Icon []BaseImage `json:"icon"`
Previews []BaseImage `json:"previews"`
HasAnimation BaseBoolInt `json:"has_animation"`
}

// StoreSticker struct.
type StoreSticker struct {
StickerID int `json:"sticker_id"`
IsAllowed BaseBoolInt `json:"is_allowed"`
Images []BaseImage `json:"images"`
ImagesWithBackground []BaseImage `json:"images_with_background"`
AnimationURL string `json:"animation_url"`
Title string `json:"title"`
Stickers []BaseSticker `json:"stickers"`
Icon []BaseImage `json:"icon"`
Previews []BaseImage `json:"previews"`
HasAnimation BaseBoolInt `json:"has_animation"`
}

0 comments on commit 6c49ab4

Please sign in to comment.