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

Product::productList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Abbotton\DouDian\Api;
4
5
use Illuminate\Http\Client\RequestException;
6
use Psr\SimpleCache\InvalidArgumentException;
7
8
class Product extends BaseRequest
9
{
10
    /**
11
     * 运费模板查询.
12
     *
13
     * @param  array  $params
14
     * @return array
15
     *
16
     * @throws RequestException
17
     * @throws InvalidArgumentException
18
     */
19
    public function freightTemplateList(array $params = []): array
20
    {
21
        return $this->httpPost('freightTemplate/list', $params);
22
    }
23
24
    /**
25
     * 商品发布新接口.
26
     *
27
     * @param  array  $params
28
     * @return array
29
     *
30
     * @throws RequestException
31
     * @throws InvalidArgumentException
32
     */
33
    public function productAddV2(array $params): array
34
    {
35
        return $this->httpPost('product/addV2', $params);
36
    }
37
38
    /**
39
     * 删除商品
40
     *
41
     * @param  array  $params
42
     * @return array
43
     *
44
     * @throws RequestException
45
     * @throws InvalidArgumentException
46
     */
47
    public function productDel(array $params): array
48
    {
49
        return $this->httpPost('product/del', $params);
50
    }
51
52
    /**
53
     * 获取商品详情.
54
     *
55
     * @param  array  $params
56
     * @return array
57
     *
58
     * @throws RequestException
59
     * @throws InvalidArgumentException
60
     */
61
    public function productDetail(array $params): array
62
    {
63
        return $this->httpPost('product/detail', $params);
64
    }
65
66
    /**
67
     * 设置商品限购.
68
     *
69
     * @param  array  $params
70
     * @return array
71
     *
72
     * @throws RequestException
73
     * @throws InvalidArgumentException
74
     */
75
    public function editBuyerLimit(array $params): array
76
    {
77
        return $this->httpPost('product/editBuyerLimit', $params);
78
    }
79
80
    /**
81
     * 商品编辑新接口.
82
     *
83
     * @param  array  $params
84
     * @return array
85
     *
86
     * @throws RequestException
87
     * @throws InvalidArgumentException
88
     */
89
    public function productEditV2(array $params): array
90
    {
91
        return $this->httpPost('product/editV2', $params);
92
    }
93
94
    /**
95
     * 根据商品分类获取对应的属性列表.
96
     *
97
     * @param  array  $params
98
     * @return array
99
     *
100
     * @throws RequestException
101
     * @throws InvalidArgumentException
102
     */
103
    public function getCateProperty(array $params): array
104
    {
105
        return $this->httpPost('product/getCateProperty', $params);
106
    }
107
108
    /**
109
     * 商品下架.
110
     *
111
     * @param  array  $params
112
     * @return array
113
     *
114
     * @throws RequestException
115
     * @throws InvalidArgumentException
116
     */
117
    public function setOffline(array $params): array
118
    {
119
        return $this->httpPost('product/setOffline', $params);
120
    }
121
122
    /**
123
     * 商品上架.
124
     *
125
     * @param  array  $params
126
     * @return array
127
     *
128
     * @throws RequestException
129
     * @throws InvalidArgumentException
130
     */
131
    public function setOnline(array $params): array
132
    {
133
        return $this->httpPost('product/setOnline', $params);
134
    }
135
136
    /**
137
     * 获取商品sku详情.
138
     *
139
     * @param  array  $params
140
     * @return array
141
     *
142
     * @throws RequestException
143
     * @throws InvalidArgumentException
144
     */
145
    public function skuDetail(array $params): array
146
    {
147
        return $this->httpPost('sku/detail', $params);
148
    }
149
150
    /**
151
     * 修改sku编码
152
     *
153
     * @param  array  $params
154
     * @return array
155
     *
156
     * @throws RequestException
157
     * @throws InvalidArgumentException
158
     */
159
    public function editCode(array $params): array
160
    {
161
        return $this->httpPost('sku/editCode', $params);
162
    }
163
164
    /**
165
     * 编辑sku价格
166
     *
167
     * @param  array  $params
168
     * @return array
169
     *
170
     * @throws RequestException
171
     * @throws InvalidArgumentException
172
     */
173
    public function editPrice(array $params): array
174
    {
175
        return $this->httpPost('sku/editPrice', $params);
176
    }
177
178
    /**
179
     * 获取商品sku列表.
180
     *
181
     * @param  array  $params
182
     * @return array
183
     *
184
     * @throws RequestException
185
     * @throws InvalidArgumentException
186
     */
187
    public function skuList(array $params): array
188
    {
189
        return $this->httpPost('sku/list', $params);
190
    }
191
192
    /**
193
     * 修改sku库存.
194
     *
195
     * @param  array  $params
196
     * @return array
197
     *
198
     * @throws RequestException
199
     * @throws InvalidArgumentException
200
     */
201
    public function syncStock(array $params): array
202
    {
203
        return $this->httpPost('sku/syncStock', $params);
204
    }
205
206
    /**
207
     * 批量同步库存接口.
208
     *
209
     * @param  array  $params
210
     * @return array
211
     *
212
     * @throws RequestException
213
     * @throws InvalidArgumentException
214
     */
215
    public function syncStockBatch(array $params): array
216
    {
217
        return $this->httpPost('sku/syncStockBatch', $params);
218
    }
219
220
    /**
221
     * 获取商品列表新版.
222
     *
223
     * @param  array  $params
224
     * @return array
225
     *
226
     * @throws InvalidArgumentException
227
     * @throws RequestException
228
     */
229
    public function listV2(array $params): array
230
    {
231
        return $this->httpPost('product/listV2', $params);
232
    }
233
234
    /**
235
     * 获取商品列表新版.
236
     *
237
     * @param  array  $params
238
     * @return array
239
     *
240
     * @throws InvalidArgumentException
241
     * @throws RequestException
242
     */
243
    public function opptyProductApply(array $params): array
244
    {
245
        return $this->httpPost('opptyProduct/apply', $params);
246
    }
247
248
    /**
249
     * 机会品线索触达.
250
     *
251
     * @param  array  $params
252
     * @return array
253
     *
254
     * @throws InvalidArgumentException
255
     * @throws RequestException
256
     */
257
    public function opptyProductClue(array $params): array
258
    {
259
        return $this->httpPost('opptyProduct/clue', $params);
260
    }
261
262
    /**
263
     * 机会品提报进度查询.
264
     *
265
     * @param  array  $params
266
     * @return array
267
     *
268
     * @throws InvalidArgumentException
269
     * @throws RequestException
270
     */
271
    public function opptyProductGetApplyProgress(array $params): array
272
    {
273
        return $this->httpPost('opptyProduct/getApplyProgress', $params);
274
    }
275
}
276