Spu   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 60
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A addShopSpu() 0 3 1
A getSpuTpl() 0 3 1
A getSpuInfoBySpuId() 0 3 1
A getKeyPropertyByCid() 0 3 1
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