Spu::getKeyPropertyByCid()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Abbotton\DouDian\Api;
4
5
use Illuminate\Http\Client\RequestException;
6
use Psr\SimpleCache\InvalidArgumentException;
7
8
class Spu extends BaseRequest
9
{
10
    /**
11
     * 关键属性查询接口.
12
     *
13
     * @param array $params
14
     *
15
     * @throws RequestException
16
     * @throws InvalidArgumentException
17
     *
18
     * @return array
19
     */
20
    public function getKeyPropertyByCid(array $params): array
21
    {
22
        return $this->httpPost('spu/getKeyPropertyByCid', $params);
23
    }
24
25
    /**
26
     * SPU信息查看.
27
     *
28
     * @param array $params
29
     *
30
     * @throws InvalidArgumentException
31
     * @throws RequestException
32
     *
33
     * @return array
34
     */
35
    public function getSpuInfoBySpuId(array $params): array
36
    {
37
        return $this->httpPost('spu/getSpuInfoBySpuId', $params);
38
    }
39
40
    /**
41
     * 获取spu模板.
42
     *
43
     * @param array $params
44
     *
45
     * @throws InvalidArgumentException
46
     * @throws RequestException
47
     *
48
     * @return array
49
     */
50
    public function getSpuTpl(array $params): array
51
    {
52
        return $this->httpPost('spu/getSpuTpl', $params);
53
    }
54
55
    /**
56
     * 通过关键属性获取SPU信息.
57
     *
58
     * @param array $params
59
     *
60
     * @throws InvalidArgumentException
61
     * @throws RequestException
62
     *
63
     * @return array
64
     */
65
    public function addShopSpu(array $params): array
66
    {
67
        return $this->httpPost('spu/addShopSpu', $params);
68
    }
69
}
70