Total Complexity | 106 |
Total Lines | 1448 |
Duplicated Lines | 0 % |
Changes | 11 | ||
Bugs | 0 | Features | 0 |
Complex classes like TbkService often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use TbkService, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
33 | class TbkService extends Service |
||
34 | { |
||
35 | /** |
||
36 | * 是否为沙箱 |
||
37 | * @var bool |
||
38 | */ |
||
39 | private $sandbox = false; |
||
40 | |||
41 | /** |
||
42 | * TOP分配给应用的 |
||
43 | * @var string |
||
44 | */ |
||
45 | private $app_key, $app_secret = ""; |
||
46 | |||
47 | /** |
||
48 | * API接口名称 |
||
49 | * @var string |
||
50 | */ |
||
51 | private $method = ''; |
||
52 | |||
53 | /** |
||
54 | * 签名的摘要算法 |
||
55 | * @var string |
||
56 | */ |
||
57 | private $sign_method = "md5"; |
||
58 | |||
59 | /** |
||
60 | * 需要发送的的参数 |
||
61 | * @var |
||
62 | */ |
||
63 | private $param; |
||
64 | |||
65 | /** |
||
66 | * 响应格式 |
||
67 | * @var string |
||
68 | */ |
||
69 | private $format = "json"; |
||
70 | |||
71 | /** |
||
72 | * API协议版本 |
||
73 | * @var string |
||
74 | */ |
||
75 | private $v = "2.0"; |
||
76 | |||
77 | /** |
||
78 | * 响应内容 |
||
79 | * @var |
||
80 | */ |
||
81 | private $output; |
||
82 | |||
83 | /** |
||
84 | * 安全协议 |
||
85 | * @var string |
||
86 | */ |
||
87 | private $protocol = 'http'; |
||
88 | |||
89 | /** |
||
90 | * 设置安全协议 |
||
91 | * @param string $protocol |
||
92 | * @return $this |
||
93 | */ |
||
94 | public function setProtocol($protocol = 'http'): self |
||
95 | { |
||
96 | $this->protocol = $protocol; |
||
97 | return $this; |
||
98 | } |
||
99 | |||
100 | /** |
||
101 | * 是否为沙箱 |
||
102 | * @return $this |
||
103 | */ |
||
104 | public function sandbox(): self |
||
105 | { |
||
106 | $this->sandbox = true; |
||
107 | return $this; |
||
108 | } |
||
109 | |||
110 | /** |
||
111 | * 配置应用的AppKey |
||
112 | * @param string $appKey |
||
113 | * @return $this |
||
114 | */ |
||
115 | public function appKey(string $appKey): self |
||
116 | { |
||
117 | $this->app_key = $appKey; |
||
118 | return $this; |
||
119 | } |
||
120 | |||
121 | /** |
||
122 | * 应用AppSecret |
||
123 | * @param string $appSecret |
||
124 | * @return $this |
||
125 | */ |
||
126 | public function appSecret(string $appSecret): self |
||
127 | { |
||
128 | $this->app_secret = $appSecret; |
||
129 | return $this; |
||
130 | } |
||
131 | |||
132 | /** |
||
133 | * API接口名称 |
||
134 | * @param string $signMethod |
||
135 | * @return $this |
||
136 | */ |
||
137 | public function signMethod(string $signMethod): self |
||
138 | { |
||
139 | $this->sign_method = $signMethod; |
||
140 | return $this; |
||
141 | } |
||
142 | |||
143 | /** |
||
144 | * 请求参数 |
||
145 | * @param array $param |
||
146 | * @return $this |
||
147 | */ |
||
148 | public function param(array $param): self |
||
149 | { |
||
150 | $this->param = $param; |
||
151 | return $this; |
||
152 | } |
||
153 | |||
154 | /** |
||
155 | * 获取配置信息 |
||
156 | * @return $this |
||
157 | */ |
||
158 | private function getConfig(): self |
||
159 | { |
||
160 | $this->app_key = config('dtapp.taobao.tbk.app_key'); |
||
161 | $this->app_secret = config('dtapp.taobao.tbk.app_secret'); |
||
162 | return $this; |
||
163 | } |
||
164 | |||
165 | /** |
||
166 | * 淘宝客-推广者-所有订单查询 |
||
167 | * @return $this |
||
168 | */ |
||
169 | public function orderDetailsGet(): self |
||
170 | { |
||
171 | $this->method = 'taobao.tbk.order.details.get'; |
||
172 | return $this; |
||
173 | } |
||
174 | |||
175 | /** |
||
176 | * 淘宝客-服务商-所有订单查询 |
||
177 | * @return $this |
||
178 | */ |
||
179 | public function scOrderDetailsGet(): self |
||
180 | { |
||
181 | $this->method = 'taobao.tbk.sc.order.details.get'; |
||
182 | return $this; |
||
183 | } |
||
184 | |||
185 | /** |
||
186 | * 淘宝客-服务商-淘口令解析&转链 |
||
187 | * @return $this |
||
188 | */ |
||
189 | public function scTpwdConvert(): self |
||
190 | { |
||
191 | $this->method = 'taobao.tbk.sc.tpwd.convert'; |
||
192 | return $this; |
||
193 | } |
||
194 | |||
195 | /** |
||
196 | * 淘宝客-服务商-维权退款订单查询 |
||
197 | * @return $this |
||
198 | */ |
||
199 | public function scRelationRefund(): self |
||
200 | { |
||
201 | $this->method = 'taobao.tbk.sc.relation.refund'; |
||
202 | return $this; |
||
203 | } |
||
204 | |||
205 | /** |
||
206 | * 淘宝客-服务商-店铺链接转换 |
||
207 | * @return $this |
||
208 | */ |
||
209 | public function scShopConvert(): self |
||
210 | { |
||
211 | $this->method = 'taobao.tbk.sc.shop.convert'; |
||
212 | return $this; |
||
213 | } |
||
214 | |||
215 | /** |
||
216 | * 淘宝客-推广者-官办找福利页 |
||
217 | * @return $this |
||
218 | */ |
||
219 | public function jzfConvert(): self |
||
220 | { |
||
221 | $this->method = 'taobao.tbk.jzf.convert'; |
||
222 | return $this; |
||
223 | } |
||
224 | |||
225 | /** |
||
226 | * 淘宝客-推广者-维权退款订单查询 |
||
227 | * @return $this |
||
228 | */ |
||
229 | public function relationRefund(): self |
||
230 | { |
||
231 | $this->method = 'taobao.tbk.relation.refund'; |
||
232 | return $this; |
||
233 | } |
||
234 | |||
235 | /** |
||
236 | * 淘宝客-服务商-淘礼金创建 |
||
237 | * @return $this |
||
238 | */ |
||
239 | public function scVegasTljCreate(): self |
||
240 | { |
||
241 | $this->method = 'taobao.tbk.sc.vegas.tlj.create'; |
||
242 | return $this; |
||
243 | } |
||
244 | |||
245 | /** |
||
246 | * 淘宝客商品展示规则获取 |
||
247 | * @return $this |
||
248 | */ |
||
249 | public function itemRuleGet(): self |
||
250 | { |
||
251 | $this->method = 'qimen.taobao.tbk.item.rule.get'; |
||
252 | return $this; |
||
253 | } |
||
254 | |||
255 | /** |
||
256 | * 淘宝客-推广者-处罚订单查询 |
||
257 | * @return $this |
||
258 | */ |
||
259 | public function dgPunishOrderGet(): self |
||
260 | { |
||
261 | $this->method = 'taobao.tbk.dg.punish.order.get'; |
||
262 | return $this; |
||
263 | } |
||
264 | |||
265 | /** |
||
266 | * 淘宝客-公用-淘口令解析出原链接 |
||
267 | * @return $this |
||
268 | */ |
||
269 | public function tpwdParse(): self |
||
270 | { |
||
271 | $this->method = 'taobao.tbk.tpwd.parse'; |
||
272 | return $this; |
||
273 | } |
||
274 | |||
275 | /** |
||
276 | * 淘宝客-推广者-新用户订单明细查询 |
||
277 | * @return $this |
||
278 | */ |
||
279 | public function dgNewUserOrderGet(): self |
||
280 | { |
||
281 | $this->method = 'taobao.tbk.dg.newuser.order.get'; |
||
282 | return $this; |
||
283 | } |
||
284 | |||
285 | /** |
||
286 | * 淘宝客-服务商-新用户订单明细查询 |
||
287 | * @return $this |
||
288 | */ |
||
289 | public function scNewuserOrderGet(): self |
||
290 | { |
||
291 | $this->method = 'taobao.tbk.sc.newuser.order.get'; |
||
292 | return $this; |
||
293 | } |
||
294 | |||
295 | /** |
||
296 | * 淘宝客-推广者-拉新活动对应数据查询 |
||
297 | * @return $this |
||
298 | */ |
||
299 | public function dgNewUserOrderSum(): self |
||
300 | { |
||
301 | $this->method = 'taobao.tbk.dg.newuser.order.sum'; |
||
302 | return $this; |
||
303 | } |
||
304 | |||
305 | /** |
||
306 | * 超级红包发放个数 - 淘宝客-推广者-查询超级红包发放个数 |
||
307 | * https://open.taobao.com/api.htm?spm=a2e0r.13193907.0.0.210524ad2gvyOW&docId=47593&docType=2 |
||
308 | * @return $this |
||
309 | */ |
||
310 | public function dgVegasSendReport(): self |
||
311 | { |
||
312 | $this->method = 'taobao.tbk.dg.vegas.send.report'; |
||
313 | return $this; |
||
314 | } |
||
315 | |||
316 | /** |
||
317 | * 淘宝客-推广者-官方活动转链 |
||
318 | * @return $this |
||
319 | */ |
||
320 | public function activityInfoGet(): self |
||
321 | { |
||
322 | $this->method = 'taobao.tbk.activity.info.get'; |
||
323 | return $this; |
||
324 | } |
||
325 | |||
326 | /** |
||
327 | * 淘宝客-服务商-官方活动转链 |
||
328 | * @return $this |
||
329 | */ |
||
330 | public function scActivityInfoGet(): self |
||
331 | { |
||
332 | $this->method = 'taobao.tbk.sc.activity.info.get'; |
||
333 | return $this; |
||
334 | } |
||
335 | |||
336 | /** |
||
337 | * 淘宝客-推广者-联盟口令生成 |
||
338 | * @return $this |
||
339 | */ |
||
340 | public function textTpwdCreate(): self |
||
341 | { |
||
342 | $this->method = 'taobao.tbk.text.tpwd.create'; |
||
343 | return $this; |
||
344 | } |
||
345 | |||
346 | /** |
||
347 | * 淘宝客-推广者-官方活动转链(2020.9.30下线) |
||
348 | * @return $this |
||
349 | */ |
||
350 | public function activityLinkGet(): self |
||
351 | { |
||
352 | $this->method = 'taobao.tbk.activitylink.get'; |
||
353 | return $this; |
||
354 | } |
||
355 | |||
356 | /** |
||
357 | * 淘宝客-公用-淘口令生成 |
||
358 | * @return $this |
||
359 | */ |
||
360 | public function tpWdCreate(): self |
||
361 | { |
||
362 | $this->method = 'taobao.tbk.tpwd.create'; |
||
363 | return $this; |
||
364 | } |
||
365 | |||
366 | /** |
||
367 | * 淘宝客-公用-长链转短链 |
||
368 | * @return $this |
||
369 | */ |
||
370 | public function spreadGet(): self |
||
371 | { |
||
372 | $this->method = 'taobao.tbk.spread.get'; |
||
373 | return $this; |
||
374 | } |
||
375 | |||
376 | /** |
||
377 | * 聚划算商品搜索接口 |
||
378 | * https://open.taobao.com/api.htm?docId=28762&docType=2&scopeId=16517 |
||
379 | * @return $this |
||
380 | */ |
||
381 | public function itemsSearch(): self |
||
382 | { |
||
383 | $this->method = 'taobao.ju.items.search'; |
||
384 | return $this; |
||
385 | } |
||
386 | |||
387 | /** |
||
388 | * 淘抢购api(2020.9.30下线) |
||
389 | * @return $this |
||
390 | */ |
||
391 | public function juTqgGet(): self |
||
392 | { |
||
393 | $this->method = 'taobao.tbk.ju.tqg.get'; |
||
394 | return $this; |
||
395 | } |
||
396 | |||
397 | /** |
||
398 | * 淘宝客-推广者-淘礼金创建 |
||
399 | * @return $this |
||
400 | */ |
||
401 | public function dgVegasTljCreate(): self |
||
402 | { |
||
403 | $this->method = 'taobao.tbk.dg.vegas.tlj.create'; |
||
404 | return $this; |
||
405 | } |
||
406 | |||
407 | /** |
||
408 | * 淘宝客-推广者-轻店铺淘口令解析 |
||
409 | * @return $this |
||
410 | */ |
||
411 | public function lightshopTbpswdParse(): self |
||
412 | { |
||
413 | $this->method = 'taobao.tbk.lightshop.tbpswd.parse'; |
||
414 | return $this; |
||
415 | } |
||
416 | |||
417 | /** |
||
418 | * 淘宝客-推广者-淘礼金发放及使用报表 |
||
419 | * @return $this |
||
420 | */ |
||
421 | public function dgVegasTljInstanceReport(): self |
||
422 | { |
||
423 | $this->method = 'taobao.tbk.dg.vegas.tlj.instance.report'; |
||
424 | return $this; |
||
425 | } |
||
426 | |||
427 | /** |
||
428 | * 淘宝客-服务商-手淘群发单 |
||
429 | * @return $this |
||
430 | */ |
||
431 | public function scGroupchatMessageSend(): self |
||
432 | { |
||
433 | $this->method = 'taobao.tbk.sc.groupchat.message.send'; |
||
434 | return $this; |
||
435 | } |
||
436 | |||
437 | /** |
||
438 | * 淘宝客-服务商-手淘群创建 |
||
439 | * @return $this |
||
440 | */ |
||
441 | public function scGroupchatCreate(): self |
||
442 | { |
||
443 | $this->method = 'taobao.tbk.sc.groupchat.create'; |
||
444 | return $this; |
||
445 | } |
||
446 | |||
447 | /** |
||
448 | * 淘宝客-服务商-手淘群查询 |
||
449 | * @return $this |
||
450 | */ |
||
451 | public function scGroupchatGet(): self |
||
452 | { |
||
453 | $this->method = 'taobao.tbk.sc.groupchat.get'; |
||
454 | return $this; |
||
455 | } |
||
456 | |||
457 | /** |
||
458 | * 淘宝客-公用-手淘注册用户判定 |
||
459 | * @return $this |
||
460 | */ |
||
461 | public function tbinfoGet(): self |
||
462 | { |
||
463 | $this->method = 'taobao.tbk.tbinfo.get'; |
||
464 | return $this; |
||
465 | } |
||
466 | |||
467 | /** |
||
468 | * 淘宝客-公用-pid校验 |
||
469 | * @return $this |
||
470 | */ |
||
471 | public function tbkinfoGet(): self |
||
472 | { |
||
473 | $this->method = 'taobao.tbk.tbkinfo.get'; |
||
474 | return $this; |
||
475 | } |
||
476 | |||
477 | /** |
||
478 | * 淘宝客-公用-私域用户邀请码生成 |
||
479 | * @return $this |
||
480 | */ |
||
481 | public function scInvIteCodeGet(): self |
||
482 | { |
||
483 | $this->method = 'taobao.tbk.sc.invitecode.get'; |
||
484 | return $this; |
||
485 | } |
||
486 | |||
487 | /** |
||
488 | * 淘宝客-公用-私域用户备案信息查询 |
||
489 | * @return $this |
||
490 | */ |
||
491 | public function scPublisherInfoGet(): self |
||
492 | { |
||
493 | $this->method = 'taobao.tbk.sc.publisher.info.get'; |
||
494 | return $this; |
||
495 | } |
||
496 | |||
497 | /** |
||
498 | * 淘宝客-公用-私域用户备案 |
||
499 | * @return $this |
||
500 | */ |
||
501 | public function scPublisherInfoSave(): self |
||
502 | { |
||
503 | $this->method = 'taobao.tbk.sc.publisher.info.save'; |
||
504 | return $this; |
||
505 | } |
||
506 | |||
507 | /** |
||
508 | * 淘宝客-公用-淘宝客商品详情查询(简版) |
||
509 | * @return $this |
||
510 | */ |
||
511 | public function itemInfoGet(): self |
||
512 | { |
||
513 | $this->method = 'taobao.tbk.item.info.get'; |
||
514 | return $this; |
||
515 | } |
||
516 | |||
517 | /** |
||
518 | * 淘宝客-公用-阿里妈妈推广券详情查询 |
||
519 | * @return $this |
||
520 | */ |
||
521 | public function couponGet(): self |
||
522 | { |
||
523 | $this->method = 'taobao.tbk.coupon.get'; |
||
524 | return $this; |
||
525 | } |
||
526 | |||
527 | /** |
||
528 | * 淘宝客-推广者-物料搜索 |
||
529 | * @return $this |
||
530 | */ |
||
531 | public function dgMaterialOptional(): self |
||
532 | { |
||
533 | $this->method = 'taobao.tbk.dg.material.optional'; |
||
534 | return $this; |
||
535 | } |
||
536 | |||
537 | /** |
||
538 | * 淘宝客-推广者-店铺搜索 |
||
539 | * @return $this |
||
540 | */ |
||
541 | public function shopGet(): self |
||
542 | { |
||
543 | $this->method = 'taobao.tbk.shop.get'; |
||
544 | return $this; |
||
545 | } |
||
546 | |||
547 | /** |
||
548 | * 淘宝客-推广者-物料精选 |
||
549 | * @return $this |
||
550 | */ |
||
551 | public function dgOpTiUsMaterial(): self |
||
552 | { |
||
553 | $this->method = 'taobao.tbk.dg.optimus.material'; |
||
554 | return $this; |
||
555 | } |
||
556 | |||
557 | /** |
||
558 | * 淘宝客-推广者-图文内容输出(2020.9.30下线) |
||
559 | * @return $this |
||
560 | */ |
||
561 | public function contentGet(): self |
||
562 | { |
||
563 | $this->method = 'taobao.tbk.content.get'; |
||
564 | return $this; |
||
565 | } |
||
566 | |||
567 | /** |
||
568 | * 淘宝客-推广者-图文内容效果数据(2020.9.30下线) |
||
569 | * @return $this |
||
570 | */ |
||
571 | public function contentEffectGet(): self |
||
572 | { |
||
573 | $this->method = 'taobao.tbk.content.effect.get'; |
||
574 | return $this; |
||
575 | } |
||
576 | |||
577 | |||
578 | /** |
||
579 | * 淘宝客-推广者-商品出词 |
||
580 | * @return $this |
||
581 | */ |
||
582 | public function itemWordGet(): self |
||
583 | { |
||
584 | $this->method = 'taobao.tbk.item.word.get'; |
||
585 | return $this; |
||
586 | } |
||
587 | |||
588 | /** |
||
589 | * 淘宝客-推广者-商品链接转换 |
||
590 | * @return $this |
||
591 | */ |
||
592 | public function itemConvert(): self |
||
593 | { |
||
594 | $this->method = 'taobao.tbk.item.convert'; |
||
595 | return $this; |
||
596 | } |
||
597 | |||
598 | /** |
||
599 | * 淘宝客-公用-链接解析出商品id |
||
600 | * @return $this |
||
601 | */ |
||
602 | public function itemClickExtract(): self |
||
603 | { |
||
604 | $this->method = 'taobao.tbk.item.click.extract'; |
||
605 | return $this; |
||
606 | } |
||
607 | |||
608 | /** |
||
609 | * 淘宝客-公用-商品关联推荐(2020.9.30下线) |
||
610 | * @return $this |
||
611 | */ |
||
612 | public function itemRecommendGet(): self |
||
613 | { |
||
614 | $this->method = 'taobao.tbk.item.recommend.get'; |
||
615 | return $this; |
||
616 | } |
||
617 | |||
618 | /** |
||
619 | * 淘宝客-公用-店铺关联推荐 |
||
620 | * @return $this |
||
621 | */ |
||
622 | public function shopRecommendGet(): self |
||
623 | { |
||
624 | $this->method = 'taobao.tbk.shop.recommend.get'; |
||
625 | return $this; |
||
626 | } |
||
627 | |||
628 | /** |
||
629 | * 淘宝客-推广者-选品库宝贝信息(2020.9.30下线) |
||
630 | * @return $this |
||
631 | */ |
||
632 | public function uaTmFavoritesItemGet(): self |
||
633 | { |
||
634 | $this->method = 'taobao.tbk.uatm.favorites.item.get'; |
||
635 | return $this; |
||
636 | } |
||
637 | |||
638 | /** |
||
639 | * 淘宝客-推广者-选品库宝贝列表(2020.9.30下线) |
||
640 | * @return $this |
||
641 | */ |
||
642 | public function uaTmFavoritesGet(): self |
||
643 | { |
||
644 | $this->method = 'taobao.tbk.uatm.favorites.get'; |
||
645 | return $this; |
||
646 | } |
||
647 | |||
648 | /** |
||
649 | * 淘宝客-服务商-官方活动转链(2020.9.30下线) |
||
650 | * @return $this |
||
651 | */ |
||
652 | public function scActivityLinkToolGet(): self |
||
653 | { |
||
654 | $this->method = 'taobao.tbk.sc.activitylink.toolget'; |
||
655 | return $this; |
||
656 | } |
||
657 | |||
658 | /** |
||
659 | * 淘宝客-服务商-处罚订单查询 |
||
660 | * @return $this |
||
661 | */ |
||
662 | public function scPunishOrderGet(): self |
||
663 | { |
||
664 | $this->method = 'taobao.tbk.sc.punish.order.get'; |
||
665 | return $this; |
||
666 | } |
||
667 | |||
668 | /** |
||
669 | * 淘宝客-推广者-创建推广位 |
||
670 | * @return $this |
||
671 | */ |
||
672 | public function adZoneCreate(): self |
||
673 | { |
||
674 | $this->method = 'taobao.tbk.adzone.create'; |
||
675 | return $this; |
||
676 | } |
||
677 | |||
678 | /** |
||
679 | * 淘宝客文本淘口令 |
||
680 | * @return $this |
||
681 | */ |
||
682 | public function tpwdMixCreate(): self |
||
683 | { |
||
684 | $this->method = 'taobao.tbk.tpwd.mix.create'; |
||
685 | return $this; |
||
686 | } |
||
687 | |||
688 | /** |
||
689 | * 淘宝客-推广者-b2c平台用户行为跟踪服务商 |
||
690 | * @return $this |
||
691 | */ |
||
692 | public function traceBtocAddtrace(): self |
||
693 | { |
||
694 | $this->method = 'taobao.tbk.trace.btoc.addtrace'; |
||
695 | return $this; |
||
696 | } |
||
697 | |||
698 | /** |
||
699 | * 淘宝客-推广者-登陆信息跟踪服务商 |
||
700 | * @return $this |
||
701 | */ |
||
702 | public function traceLogininfoAdd(): self |
||
703 | { |
||
704 | $this->method = 'taobao.tbk.trace.logininfo.add'; |
||
705 | return $this; |
||
706 | } |
||
707 | |||
708 | /** |
||
709 | * 淘宝客-推广者-用户行为跟踪服务商 |
||
710 | * @return $this |
||
711 | */ |
||
712 | public function traceShopitemAddtrace(): self |
||
713 | { |
||
714 | $this->method = 'taobao.tbk.trace.shopitem.addtrace'; |
||
715 | return $this; |
||
716 | } |
||
717 | |||
718 | /** |
||
719 | * 淘宝客-推广者-商品三方分成链接转换 |
||
720 | * @return $this |
||
721 | */ |
||
722 | public function itemShareConvert(): self |
||
723 | { |
||
724 | $this->method = 'taobao.tbk.item.share.convert'; |
||
725 | return $this; |
||
726 | } |
||
727 | |||
728 | /** |
||
729 | * 淘宝客-推广者-店铺链接转换 |
||
730 | * @return $this |
||
731 | */ |
||
732 | public function shopConvert(): self |
||
733 | { |
||
734 | $this->method = 'taobao.tbk.shop.convert'; |
||
735 | return $this; |
||
736 | } |
||
737 | |||
738 | /** |
||
739 | * 淘宝客-推广者-店铺三方分成链接转换 |
||
740 | * @return $this |
||
741 | */ |
||
742 | public function shopShareConvert(): self |
||
743 | { |
||
744 | $this->method = 'taobao.tbk.shop.share.convert'; |
||
745 | return $this; |
||
746 | } |
||
747 | |||
748 | /** |
||
749 | * 淘宝客-推广者-返利商家授权查询 |
||
750 | * @return $this |
||
751 | */ |
||
752 | public function rebateAuthGet(): self |
||
753 | { |
||
754 | $this->method = 'taobao.tbk.rebate.auth.get'; |
||
755 | return $this; |
||
756 | } |
||
757 | |||
758 | /** |
||
759 | * 淘宝客-推广者-返利订单查询 |
||
760 | * @return $this |
||
761 | */ |
||
762 | public function rebateOrderGet(): self |
||
763 | { |
||
764 | $this->method = 'taobao.tbk.rebate.order.get'; |
||
765 | return $this; |
||
766 | } |
||
767 | |||
768 | /** |
||
769 | * 淘宝客-推广者-根据宝贝id批量查询优惠券 |
||
770 | * @return $this |
||
771 | */ |
||
772 | public function itemidCouponGet(): self |
||
773 | { |
||
774 | $this->method = 'taobao.tbk.itemid.coupon.get'; |
||
775 | return $this; |
||
776 | } |
||
777 | |||
778 | /** |
||
779 | * 淘宝客-服务商-保护门槛 |
||
780 | * @return $this |
||
781 | */ |
||
782 | public function dataReport(): self |
||
783 | { |
||
784 | $this->method = 'taobao.tbk.data.report'; |
||
785 | return $this; |
||
786 | } |
||
787 | |||
788 | /** |
||
789 | * 淘宝客-推广者-单品券高效转链 |
||
790 | * @return $this |
||
791 | */ |
||
792 | public function couponConvert(): self |
||
793 | { |
||
794 | $this->method = 'taobao.tbk.coupon.convert'; |
||
795 | return $this; |
||
796 | } |
||
797 | |||
798 | /** |
||
799 | * 淘宝客-推广者-淘口令解析&三方分成转链 |
||
800 | * @return $this |
||
801 | */ |
||
802 | public function tpwdShareConvert(): self |
||
803 | { |
||
804 | $this->method = 'taobao.tbk.tpwd.share.convert'; |
||
805 | return $this; |
||
806 | } |
||
807 | |||
808 | /** |
||
809 | * 淘宝客-推广者-淘口令解析&转链 |
||
810 | * @return $this |
||
811 | */ |
||
812 | public function tpwdConvert(): self |
||
813 | { |
||
814 | $this->method = 'taobao.tbk.tpwd.convert'; |
||
815 | return $this; |
||
816 | } |
||
817 | |||
818 | /** |
||
819 | * 淘宝客-服务商-创建推广者位 |
||
820 | * @return $this |
||
821 | */ |
||
822 | public function scAdzoneCreate(): self |
||
823 | { |
||
824 | $this->method = 'taobao.tbk.sc.adzone.create'; |
||
825 | return $this; |
||
826 | } |
||
827 | |||
828 | /** |
||
829 | * 淘宝客-服务商-物料精选 |
||
830 | * @return $this |
||
831 | */ |
||
832 | public function scOptimusMaterial(): self |
||
833 | { |
||
834 | $this->method = 'taobao.tbk.sc.optimus.material'; |
||
835 | return $this; |
||
836 | } |
||
837 | |||
838 | /** |
||
839 | * 淘宝客-服务商-物料搜索 |
||
840 | * @return $this |
||
841 | */ |
||
842 | public function scMaterialOptional(): self |
||
846 | } |
||
847 | |||
848 | /** |
||
849 | * 淘宝客-服务商-拉新活动数据查询 |
||
850 | * @return $this |
||
851 | */ |
||
852 | public function scNewuserOrderSum(): self |
||
853 | { |
||
854 | $this->method = 'taobao.tbk.sc.newuser.order.sum'; |
||
855 | return $this; |
||
856 | } |
||
857 | |||
858 | /** |
||
859 | * 自定义接口 |
||
860 | * @param string $method |
||
861 | * @return $this |
||
862 | */ |
||
863 | public function setMethod($method = ''): self |
||
864 | { |
||
865 | $this->method = $method; |
||
866 | return $this; |
||
867 | } |
||
868 | |||
869 | /** |
||
870 | * 返回Array |
||
871 | * @return array|mixed |
||
872 | * @throws DtaException |
||
873 | */ |
||
874 | public function toArray() |
||
917 | } |
||
918 | |||
919 | /** |
||
920 | * 返回Xml |
||
921 | * @return mixed |
||
922 | * @throws DtaException |
||
923 | */ |
||
924 | public function toXml() |
||
933 | } |
||
934 | |||
935 | /** |
||
936 | * 网络请求 |
||
937 | * @throws DtaException |
||
938 | */ |
||
939 | private function http(): void |
||
940 | { |
||
941 | //生成签名 |
||
942 | $sign = $this->createSign(); |
||
943 | //组织参数 |
||
944 | $strParam = $this->createStrParam(); |
||
945 | $strParam .= 'sign=' . $sign; |
||
946 | //访问服务 |
||
947 | if ($this->protocol === 'http') { |
||
948 | if (empty($this->sandbox)) { |
||
949 | $url = 'http://gw.api.taobao.com/router/rest?' . $strParam; |
||
950 | } else { |
||
951 | $url = 'http://gw.api.tbsandbox.com/router/rest?' . $strParam; |
||
952 | } |
||
953 | } |
||
954 | if ($this->protocol === 'https') { |
||
955 | if (empty($this->sandbox)) { |
||
956 | $url = 'https://eco.taobao.com/router/rest?' . $strParam; |
||
957 | } else { |
||
958 | $url = 'https://gw.api.tbsandbox.com/router/rest?' . $strParam; |
||
959 | } |
||
960 | } |
||
961 | $result = file_get_contents($url); |
||
962 | $result = json_decode($result, true); |
||
963 | $this->output = $result; |
||
964 | } |
||
965 | |||
966 | /** |
||
967 | * 签名 |
||
968 | * @return string |
||
969 | * @throws DtaException |
||
970 | */ |
||
971 | private function createSign(): string |
||
989 | } |
||
990 | |||
991 | /** |
||
992 | * 组参 |
||
993 | * @return string |
||
994 | */ |
||
995 | private function createStrParam(): string |
||
996 | { |
||
997 | $strParam = ''; |
||
998 | foreach ($this->param as $key => $val) { |
||
999 | if ($key !== '' && $val !== '') { |
||
1000 | $strParam .= $key . '=' . urlencode($val) . '&'; |
||
1001 | } |
||
1002 | } |
||
1003 | return $strParam; |
||
1004 | } |
||
1005 | |||
1006 | /** |
||
1007 | * 获取活动物料 |
||
1008 | * @return array[] |
||
1009 | */ |
||
1010 | public function getActivityMaterialIdList(): array |
||
1011 | { |
||
1012 | return [ |
||
1013 | [ |
||
1014 | // https://market.m.taobao.com/app/qn/toutiao-new/index-pc.html#/detail/10628646?_k=tcswm1 |
||
1015 | 'name' => '口碑', |
||
1016 | 'list' => [ |
||
1017 | [ |
||
1018 | 'name' => '口碑主会场活动(2.3%佣金起)', |
||
1019 | 'material_id' => 1583739244161 |
||
1020 | ], |
||
1021 | [ |
||
1022 | 'name' => '生活服务分会场活动(2.3%佣金起)', |
||
1023 | 'material_id' => 1583739244162 |
||
1024 | ] |
||
1025 | ] |
||
1026 | ], |
||
1027 | [ |
||
1028 | // https://market.m.taobao.com/app/qn/toutiao-new/index-pc.html#/detail/10628647?_k=hwggf9 |
||
1029 | // https://market.m.taobao.com/app/qn/toutiao-new/index-pc.html#/detail/10630427?_k=sdet4e |
||
1030 | // https://market.m.taobao.com/app/qn/toutiao-new/index-pc.html#/detail/10630361?_k=nq6zgt |
||
1031 | 'name' => '饿了么', |
||
1032 | 'list' => [ |
||
1033 | [ |
||
1034 | 'name' => '聚合页(6%佣金起)', |
||
1035 | 'material_id' => 1571715733668 |
||
1036 | ], |
||
1037 | [ |
||
1038 | 'name' => '新零售(4%佣金起)', |
||
1039 | 'material_id' => 1585018034441 |
||
1040 | ], |
||
1041 | [ |
||
1042 | 'name' => '餐饮', |
||
1043 | 'material_id' => 1579491209717 |
||
1044 | ], |
||
1045 | ] |
||
1046 | ], |
||
1047 | [ |
||
1048 | // https://market.m.taobao.com/app/qn/toutiao-new/index-pc.html#/detail/10634663?_k=zqgq01 |
||
1049 | 'name' => '卡券(饭票)', |
||
1050 | 'list' => [ |
||
1051 | [ |
||
1052 | 'name' => '饿了么卡券(1元以下商品)', |
||
1053 | 'material_id' => 32469 |
||
1054 | ], |
||
1055 | [ |
||
1056 | 'name' => '饿了么卡券投放全网商品库', |
||
1057 | 'material_id' => 32470 |
||
1058 | ], |
||
1059 | [ |
||
1060 | 'name' => '饿了么卡券(5折以下)', |
||
1061 | 'material_id' => 32603 |
||
1062 | ], |
||
1063 | [ |
||
1064 | 'name' => '饿了么头部全国KA商品库', |
||
1065 | 'material_id' => 32663 |
||
1066 | ], |
||
1067 | [ |
||
1068 | 'name' => '饿了么卡券招商爆品库', |
||
1069 | 'material_id' => 32738 |
||
1070 | ], |
||
1071 | ] |
||
1072 | ], |
||
1073 | ]; |
||
1074 | } |
||
1075 | |||
1076 | /** |
||
1077 | * 获取官方物料API汇总 |
||
1078 | * https://market.m.taobao.com/app/qn/toutiao-new/index-pc.html#/detail/10628875?_k=gpov9a |
||
1079 | * @return array |
||
1080 | */ |
||
1081 | public function getMaterialIdList(): array |
||
1481 | ], |
||
1482 | ] |
||
1483 | ], |
||
1484 | ]; |
||
1485 | } |
||
1486 | } |
||
1487 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths