Passed
Push — main ( 27e66b...25b76e )
by Abbotton
12:06
created

Spu   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 56
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
     * @return array
15
     *
16
     * @throws RequestException
17
     * @throws InvalidArgumentException
18
     */
19
    public function getKeyPropertyByCid(array $params): array
20
    {
21
        return $this->httpPost('spu/getKeyPropertyByCid', $params);
22
    }
23
24
    /**
25
     * SPU信息查看.
26
     *
27
     * @param  array  $params
28
     * @return array
29
     *
30
     * @throws InvalidArgumentException
31
     * @throws RequestException
32
     */
33
    public function getSpuInfoBySpuId(array $params): array
34
    {
35
        return $this->httpPost('spu/getSpuInfoBySpuId', $params);
36
    }
37
38
    /**
39
     * 获取spu模板.
40
     *
41
     * @param  array  $params
42
     * @return array
43
     *
44
     * @throws InvalidArgumentException
45
     * @throws RequestException
46
     */
47
    public function getSpuTpl(array $params): array
48
    {
49
        return $this->httpPost('spu/getSpuTpl', $params);
50
    }
51
52
    /**
53
     * 通过关键属性获取SPU信息.
54
     *
55
     * @param  array  $params
56
     * @return array
57
     *
58
     * @throws InvalidArgumentException
59
     * @throws RequestException
60
     */
61
    public function addShopSpu(array $params): array
62
    {
63
        return $this->httpPost('spu/addShopSpu', $params);
64
    }
65
}
66