|
@@ -6,6 +6,8 @@ namespace App\Http\Utils\Jutuike;
|
|
|
|
|
|
use App\Exceptions\CommonException;
|
|
use App\Exceptions\CommonException;
|
|
use App\Http\Bean\Util\Jutuike\GetOrderListParamBean;
|
|
use App\Http\Bean\Util\Jutuike\GetOrderListParamBean;
|
|
|
|
+use App\Http\Bean\Util\Jutuike\GoodsListParamBean;
|
|
|
|
+use App\Http\Bean\Util\Jutuike\GoodsSearchParamBean;
|
|
use App\Http\Enum\ErrorEnum;
|
|
use App\Http\Enum\ErrorEnum;
|
|
use App\Http\Utils\BaseUtil;
|
|
use App\Http\Utils\BaseUtil;
|
|
use App\Http\Utils\LoggerFactoryUtil;
|
|
use App\Http\Utils\LoggerFactoryUtil;
|
|
@@ -115,6 +117,7 @@ class JutuikeUtil extends BaseUtil
|
|
"content"=>$linkurl,
|
|
"content"=>$linkurl,
|
|
];
|
|
];
|
|
$res = HttpCurl::postCurl($url,$params);
|
|
$res = HttpCurl::postCurl($url,$params);
|
|
|
|
+ dd($res);
|
|
if($res["code"]!=1){
|
|
if($res["code"]!=1){
|
|
$instance = new LoggerFactoryUtil(JutuikeUtil::class);
|
|
$instance = new LoggerFactoryUtil(JutuikeUtil::class);
|
|
$instance->info("上游返回数据:".json_encode($res));
|
|
$instance->info("上游返回数据:".json_encode($res));
|
|
@@ -146,4 +149,91 @@ class JutuikeUtil extends BaseUtil
|
|
}
|
|
}
|
|
return $res["data"];
|
|
return $res["data"];
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取平台分类接口
|
|
|
|
+ * @param string $source
|
|
|
|
+ */
|
|
|
|
+ public static function goodsCategory($source)
|
|
|
|
+ {
|
|
|
|
+ $url = self::$baseJuheurl."union/goods_category";
|
|
|
|
+ $params = [
|
|
|
|
+ "pub_id"=>env("JU_TUI_KE_PUB_ID"),
|
|
|
|
+ ];
|
|
|
|
+ $params["source"] = $source;
|
|
|
|
+ $res = HttpCurl::postCurl($url,$params);
|
|
|
|
+ if($res["code"]!=1){
|
|
|
|
+ $instance = new LoggerFactoryUtil(JutuikeUtil::class);
|
|
|
|
+ $instance->info("上游返回数据:".json_encode($res));
|
|
|
|
+ throw new CommonException(ErrorEnum::ERROR_TRANS_LINK);
|
|
|
|
+ }
|
|
|
|
+ return $res["data"];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取商品列表
|
|
|
|
+ * @param GoodsListParamBean $goodsListParamBean
|
|
|
|
+ */
|
|
|
|
+ public static function goodsList(GoodsListParamBean $goodsListParamBean)
|
|
|
|
+ {
|
|
|
|
+ $url = self::$baseJuheurl."union/query_goods";
|
|
|
|
+ $params = [
|
|
|
|
+ "pub_id"=>env("JU_TUI_KE_PUB_ID"),
|
|
|
|
+ "source"=>$goodsListParamBean->getSource(),
|
|
|
|
+ "cat"=>$goodsListParamBean->getCat(),
|
|
|
|
+ "page"=>$goodsListParamBean->getPage(),
|
|
|
|
+ "pageSize"=>$goodsListParamBean->getPageSize(),
|
|
|
|
+ ];
|
|
|
|
+ $res = HttpCurl::postCurl($url,$params);
|
|
|
|
+ if($res["code"]!=1){
|
|
|
|
+ $instance = new LoggerFactoryUtil(JutuikeUtil::class);
|
|
|
|
+ $instance->info("上游返回数据:".json_encode($res));
|
|
|
|
+ throw new CommonException(ErrorEnum::ERROR_TRANS_LINK);
|
|
|
|
+ }
|
|
|
|
+ return $res["data"];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 商品搜索接口
|
|
|
|
+ * @param GoodsSearchParamBean $goodsSearchParamBean
|
|
|
|
+ */
|
|
|
|
+ public static function goodsSearch(GoodsSearchParamBean $goodsSearchParamBean)
|
|
|
|
+ {
|
|
|
|
+ $url = self::$baseJuheurl."union/search";
|
|
|
|
+ $params = [
|
|
|
|
+ "pub_id"=>env("JU_TUI_KE_PUB_ID"),
|
|
|
|
+ "sid"=>$goodsSearchParamBean->getSource(),
|
|
|
|
+ "source"=>$goodsSearchParamBean->getSource(),
|
|
|
|
+ "keyword"=>$goodsSearchParamBean->getKeyword(),
|
|
|
|
+ "sort"=>$goodsSearchParamBean->getSort(),
|
|
|
|
+ "page"=>$goodsSearchParamBean->getPage(),
|
|
|
|
+ "pageSize"=>$goodsSearchParamBean->getPageSize(),
|
|
|
|
+ ];
|
|
|
|
+ $res = HttpCurl::postCurl($url,$params);
|
|
|
|
+ if($res["code"]!=1){
|
|
|
|
+ $instance = new LoggerFactoryUtil(JutuikeUtil::class);
|
|
|
|
+ $instance->info("上游返回数据:".json_encode($res));
|
|
|
|
+ throw new CommonException(ErrorEnum::ERROR_TRANS_LINK);
|
|
|
|
+ }
|
|
|
|
+ return $res["data"];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 电商平台列表接口
|
|
|
|
+ */
|
|
|
|
+ public static function plateformList()
|
|
|
|
+ {
|
|
|
|
+ $url = self::$baseJuheurl."union/platform";
|
|
|
|
+ $params = [
|
|
|
|
+ "pub_id"=>env("JU_TUI_KE_PUB_ID")
|
|
|
|
+ ];
|
|
|
|
+ $res = HttpCurl::postCurl($url,$params);
|
|
|
|
+ if($res["code"]!=1){
|
|
|
|
+ $instance = new LoggerFactoryUtil(JutuikeUtil::class);
|
|
|
|
+ $instance->info("上游返回数据:".json_encode($res));
|
|
|
|
+ throw new CommonException(ErrorEnum::ERROR_TRANS_LINK);
|
|
|
|
+ }
|
|
|
|
+ return $res["data"];
|
|
|
|
+ }
|
|
}
|
|
}
|