Skip to content

Commit

Permalink
add: category recommended
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin committed Apr 1, 2023
1 parent 2ed0fe2 commit 3362231
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Resources/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,15 @@ public function getCategoryRule($category_id)
]
]);
}

public function categoryRecommended(string $product_name, string $description = '', array $images = [])
{
return $this->call('POST', 'product/category_recommend', [
RequestOptions::QUERY => [
'product_name' => $product_name,
'description' => $description,
'images' => $images,
]
]);
}
}
6 changes: 6 additions & 0 deletions tests/Resources/ProductTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,10 @@ public function testGetCategoryRule()
$this->caller->getCategoryRule(1);
$this->assertPreviousRequest('GET', 'products/categories/rules');
}

public function testCategoryRecommended()
{
$this->caller->categoryRecommended('product name', 'description');
$this->assertPreviousRequest('POST', 'product/category_recommend');
}
}

0 comments on commit 3362231

Please sign in to comment.