提交 c1cbca20 编写于 作者: 李光春's avatar 李光春

- 增加淘宝联盟获取官方物料API汇总

上级 25b19962
......@@ -82,7 +82,7 @@ class OssService extends Service
try {
$ossClient = new OssClient($this->accessKeyId, $this->accessKeySecret, $this->endpoint);
$ossClient->uploadFile($this->bucket, $object, $filePath);
return $this->app->config->get('dtapp.aliyun.oss.url') . $object;
return $this->app->config->get('dtapp.aliyun.oss.url', '') . $object;
} catch (OssException $e) {
return $e->getMessage();
}
......
......@@ -91,6 +91,6 @@ class BosService extends Service
// 从文件中直接上传Object
if (empty($this->bucket)) $this->getConfig();
$client->putObjectFromFile($this->bucket, $object, $filePath);
return $this->app->config->get('dtapp.baidu.bos.url') . $object;
return $this->app->config->get('dtapp.baidu.bos.url', '') . $object;
}
}
......@@ -90,7 +90,7 @@ class ObsService extends Service
'SourceFile' => $filePath // localfile为待上传的本地文件路径,需要指定到具体的文件名
]);
if (isset($resp['RequestId'])) {
return $this->app->config->get('dtapp.huaweicloud.obs.url') . $object;
return $this->app->config->get('dtapp.huaweicloud.obs.url', '') . $object;
} else {
return false;
}
......
......@@ -101,7 +101,7 @@ class Ks3Service extends Service
];
try {
$client->putObjectByFile($args);
return $this->app->config->get('dtapp.ksyun.ks3.url') . $object;
return $this->app->config->get('dtapp.ksyun.ks3.url', '') . $object;
} catch (\Ks3ServiceException $e) {
return false;
}
......
......@@ -82,6 +82,6 @@ class KodoService extends Service
// 调用 UploadManager 的 putFile 方法进行文件的上传。
list($ret, $err) = $uploadMgr->putFile($token, $object, $filePath);
if ($err !== null) return false;
else return $this->app->config->get('dtapp.qiniu.kodo.url') . $object;
else return $this->app->config->get('dtapp.qiniu.kodo.url', '') . $object;
}
}
......@@ -559,4 +559,281 @@ class TbkService extends Service
foreach ($this->param as $key => $val) if ($key != '' && $val != '') $strParam .= $key . '=' . urlencode($val) . '&';
return $strParam;
}
/**
* 获取官方物料API汇总
* https://market.m.taobao.com/app/qn/toutiao-new/index-pc.html#/detail/10628875?_k=gpov9a
* @return array
*/
public function getMaterialIdList()
{
return [
[
'name' => '相似推荐',
'list' => [
[
'name' => '相似推荐',
'material_id' => 13256
]
]
],
[
'name' => '猜你喜欢',
'list' => [
[
'name' => '含全部商品',
'material_id' => 6708
],
[
'name' => '营销商品库商品(此为具备“私域用户管理-会员运营管理功能”的媒体专用)',
'material_id' => 28017
]
]
],
[
'name' => '好券直播',
'list' => [
[
'name' => '综合',
'material_id' => 3756
],
[
'name' => '女装',
'material_id' => 3767
],
[
'name' => '家居家装',
'material_id' => 3758
],
[
'name' => '数码家电',
'material_id' => 3759
],
[
'name' => '鞋包配饰',
'material_id' => 3762
],
[
'name' => '美妆个护',
'material_id' => 3763
],
[
'name' => '男装',
'material_id' => 3764
],
[
'name' => '内衣',
'material_id' => 3765
],
[
'name' => '母婴',
'material_id' => 3760
],
[
'name' => '食品',
'material_id' => 3761
],
[
'name' => '运动户外',
'material_id' => 3766
]
]
],
[
'name' => '实时热销榜',
'list' => [
[
'name' => '综合',
'material_id' => 28026
],
[
'name' => '大服饰',
'material_id' => 28029
],
[
'name' => '大快消',
'material_id' => 28027
],
[
'name' => '电器美家',
'material_id' => 28028
]
]
],
[
'name' => '本地化生活',
'list' => [
]
],
[
'name' => '大额券',
'list' => [
[
'name' => '综合',
'material_id' => 27446
],
[
'name' => '女装',
'material_id' => 27448
],
[
'name' => '食品',
'material_id' => 27451
],
[
'name' => '美妆个护',
'material_id' => 27453
],
[
'name' => '家居家装',
'material_id' => 27798
],
[
'name' => '母婴',
'material_id' => 27454
]
]
],
[
'name' => '高佣榜',
'list' => [
[
'name' => '综合',
'material_id' => 13366
],
[
'name' => '女装',
'material_id' => 13367
],
[
'name' => '家居家装',
'material_id' => 13368
],
[
'name' => '数码家电',
'material_id' => 13369
],
[
'name' => '鞋包配饰',
'material_id' => 13370
],
[
'name' => '美妆个护',
'material_id' => 13371
],
[
'name' => '男装',
'material_id' => 13372
],
[
'name' => '内衣',
'material_id' => 13373
],
[
'name' => '母婴',
'material_id' => 13374
],
[
'name' => '食品',
'material_id' => 13375
],
[
'name' => '运动户外',
'material_id' => 13376
]
]
],
[
'name' => '品牌券',
'list' => [
]
],
[
'name' => '猫超优质爆款',
'list' => [
[
'name' => '猫超1元购凑单',
'material_id' => 27162
],
[
'name' => '猫超第二件0元',
'material_id' => 27161
],
[
'name' => '猫超单件满减包邮',
'material_id' => 27160
],
]
],
[
'name' => '聚划算单品爆款',
'list' => [
[
'name' => '开团热卖中',
'material_id' => 31371
],
[
'name' => '预热',
'material_id' => 31370
],
]
],
[
'name' => '天天特卖',
'list' => [
[
'name' => '开团热卖中',
'material_id' => 31362
],
]
],
[
'name' => '母婴主题',
'list' => [
[
'name' => '备孕',
'material_id' => 4040
],
[
'name' => '0至6个月',
'material_id' => 4041
],
[
'name' => '4至6岁',
'material_id' => 4044
],
[
'name' => '7至12个月',
'material_id' => 4042
],
[
'name' => '1至3岁',
'material_id' => 4043
],
[
'name' => '7至12岁',
'material_id' => 4045
],
]
],
[
'name' => '潮流范',
'list' => [
[
'name' => '潮流范',
'material_id' => 4093
],
]
],
[
'name' => '特惠',
'list' => [
[
'name' => '特惠',
'material_id' => 4094
],
]
],
];
}
}
......@@ -100,6 +100,6 @@ class CosService extends Service
'Body' => $file)
);
}
return $this->app->config->get('dtapp.tencent.cos.url') . $object;
return $this->app->config->get('dtapp.tencent.cos.url', '') . $object;
}
}
......@@ -44,6 +44,6 @@ class UfileService extends Service
{
list($data, $err) = UCloud_PutFile($this->bucket, $object, $filePath);
if (($err)) return false;
return $this->app->config->get('dtapp.ucloud.ufile.url') . $object;
return $this->app->config->get('dtapp.ucloud.ufile.url', '') . $object;
}
}
......@@ -77,6 +77,6 @@ class UssService extends Service
$client = new Upyun($serviceConfig);
$file = fopen($filePath, 'r');
$client->write($object, $file);
return $this->app->config->get('dtapp.upyun.uss.url') . $object;
return $this->app->config->get('dtapp.upyun.uss.url', '') . $object;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册