132 lines
4.2 KiB
PHP
132 lines
4.2 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the overtrue/wechat.
|
|
*
|
|
* (c) overtrue <i@overtrue.me>
|
|
*
|
|
* This source file is subject to the MIT license that is bundled
|
|
* with this source code in the file LICENSE.
|
|
*/
|
|
|
|
namespace TuzhiEasyWeChat\Channels\Category;
|
|
|
|
use TuzhiEasyWeChat\Kernel\BaseClient;
|
|
use TuzhiEasyWeChat\Kernel\Exceptions\InvalidArgumentException;
|
|
|
|
/**
|
|
* Class Client.
|
|
*
|
|
* @author mingyoung <mingyoungcheung@gmail.com>
|
|
*/
|
|
class Client extends BaseClient
|
|
{
|
|
/**
|
|
* 获取所有类目
|
|
* 可通过该接口获取全部的一、二、三级类目信息、类目的资质信息、商品资质信息。
|
|
*
|
|
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
|
|
*
|
|
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
|
|
* @throws \GuzzleHttp\Exception\GuzzleException
|
|
*/
|
|
public function all()
|
|
{
|
|
return $this->httpGet('channels/ec/category/all');
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取类目信息
|
|
* 根据三级类目ID获取类目的相关信息。
|
|
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
|
|
*
|
|
*
|
|
* @param $catId
|
|
*
|
|
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
|
|
* @throws \GuzzleHttp\Exception\GuzzleException
|
|
*/
|
|
public function detail($catId)
|
|
{
|
|
$params = [
|
|
'cat_id' => $catId
|
|
];
|
|
|
|
return $this->httpPostJson('channels/ec/category/detail', $params);
|
|
}
|
|
|
|
/**
|
|
* 获取可用的子类目详情
|
|
* 该接口可根据父类目ID获取可用的子类目详情。
|
|
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
|
|
*
|
|
*
|
|
* @param $fCatId 父类目ID,可先填0获取根部类目
|
|
*
|
|
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
|
|
* @throws \GuzzleHttp\Exception\GuzzleException
|
|
*/
|
|
public function getAvailablesoncategories($fCatId = 0)
|
|
{
|
|
$params = [
|
|
'f_cat_id' => $fCatId
|
|
];
|
|
|
|
return $this->httpPostJson('channels/ec/category/availablesoncategories/get', $params);
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取审核结果
|
|
* 该接口可通过审核id来查询审核结果。
|
|
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
|
|
|
|
* @param $audit_id 提交审核时返回的id,上传类目资质接口获得
|
|
*
|
|
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
|
|
* @throws \GuzzleHttp\Exception\GuzzleException
|
|
*/
|
|
public function getAudit($audit_id = 0)
|
|
{
|
|
$params = [
|
|
'audit_id' => $audit_id
|
|
];
|
|
|
|
return $this->httpPostJson('channels/ec/category/audit/get', $params);
|
|
}
|
|
|
|
/**
|
|
* 撤销类目资质审核
|
|
* 该接口可通过审核id来对类目资质的审核进行撤销。
|
|
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
|
|
|
|
* @param $audit_id 提交审核时返回的id,上传类目资质接口获得
|
|
*
|
|
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
|
|
* @throws \GuzzleHttp\Exception\GuzzleException
|
|
*/
|
|
public function cancelAudit($audit_id = 0)
|
|
{
|
|
$params = [
|
|
'audit_id' => $audit_id
|
|
];
|
|
|
|
return $this->httpPostJson('channels/ec/category/audit/cancel', $params);
|
|
}
|
|
|
|
/**
|
|
* 获取账号申请通过的类目和资质信息
|
|
* 通过该接口,用户可以查询到自己申请的类目及相应资质信息。需要注意的是,类目对应的资质要求可能会根据运营政策发生变化。因此,虽然某个资质曾经满足特定类目的申请条件,但在添加商品至该类目时,应以最新的资质要求为准。
|
|
*
|
|
* @return \Psr\Http\Message\ResponseInterface|\TuzhiEasyWeChat\Kernel\Support\Collection|array|object|string
|
|
*
|
|
* @throws \TuzhiEasyWeChat\Kernel\Exceptions\InvalidConfigException
|
|
* @throws \GuzzleHttp\Exception\GuzzleException
|
|
*/
|
|
public function getList()
|
|
{
|
|
return $this->httpGet('channels/ec/category/list/get');
|
|
}
|
|
}
|