route()->getActionName(); $flag = preg_match("/Controllers\\\(.*)@(.*)/",$controllerName,$match); if($flag){ $controllerName = $match[1]; $actionName = $match[2]; $class = "\\App\\Http\\Validate\\$controllerName"."Validate"; //判断验证是否存在 if(class_exists($class) && method_exists($class,$actionName)){ $instance = new $class(); $validateFlag = $instance->$actionName($request->all()); if(!$validateFlag){ throw new ValidateException($instance->getError(),501); } } } } /** * 成功返回 * @param array $data * @param int $code * @param string $msg * @param string $url * @return \Illuminate\Http\JsonResponse */ public function success($data = [], $code = 200, $msg = "", $url = "") { return response()->json( [ "status"=>true, "data"=>$data, "code"=>$code, "msg"=>$msg, "url"=>$url ] ); } /** * 错误返回 * @param $msg * @param string $code * @param string $url */ public function error($msg,$code="500",$url="") { return response()->json( [ "status"=>false, "data"=>"", "code"=>$code, "msg"=>$msg, "url"=>$url ] ); } /** * 生成swagger.json文件 */ public function swagger() { $swagger=\Swagger\scan(__DIR__."/../"); $swagger->saveAs('./swagger.json'); return $this->success(); } /** * 读取swagger内容 */ public function loadSwagger() { $data = json_decode(file_get_contents("./swagger.json"),true); return $data; } public function test() { // $data = JutuikeUtil::getActList(); // return $this->success($data); // $url = "0.0₤R9nsXr6r5tH₴ https://m.tb.cn/h.fWKqJYQ?sm=9652d6 2-5条 收小肚子中高腰内裤女裆收腹提臀束腰塑身三角裤"; // // $res = preg_match("/https\:\/\/m\.tb\.cn/",$url,$match); // dump($res); // dd($match); // $url = "https://m.vip.com/product-1710619050-6919460940636579082.html?nmsns=shop_iphone-7.54.6-link&nst=product&nsbc=&nct=link&ncid=e65103bd61351bb17486b16b4492127425d68046&nabtid=13&nuid=&nchl_param=share:e65103bd61351bb17486b16b4492127425d68046:1632980761329&mars_cid_a=e65103bd61351bb17486b16b4492127425d68046&chl_type=share"; // $res = preg_match("/https\:\/\/m\.vip\.com/",$url,$match); $url = "https://item.m.jd.com/product/13441798.html?&utm_source=iosapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=CopyURL&ad_od=share"; // $url = "2👈啊brXxXrh98ep哈 https://m.tb.cn/h.fWqjHlK?sm=4fbca7 心相印纸巾茶语丝享抽纸家用实惠装餐巾纸面巾纸心心相印纸巾6包"; // $url = "https://m-goods.kaola.com/product/1383664.html?shareOs=iOS&datid=__da_230bb323_5691a97408c33c80&klasspm=a215sy.page_kla_productpage.growthshare.copylink"; dump($url); $goods = JutuikeUtil::transferGoodsLink($url); // dump($goods); dump($goods["data"]["goodsId"]); $data = JutuikeUtil::convert($goods["data"]["goodsId"],"jtkupstream21","jd"); // dd($data); // return $this->success($data); // $oauthRes = DuoDuoKeUtil::memberAuthorityQuery("23985775_220421267"); // if(!$oauthRes["authority_query_response"]["bind"]){ // //未备案 // $beanData = [ // "p_id"=>"23985775_220421267", // "goods_sign_list"=>json_encode(["Y9f2liecoxFRU4gRwfDZm_tBr6P0jzj2_JKXkSmwdy"]), // ]; // // $beanData["generate_authority_url"] = "true"; // $generateBean = new GoodsPromotionUrlGenerateParamBean($beanData); // $res = DuoDuoKeUtil::goodsPromotionUrlGenerate($generateBean); // dd($res); // }else{ // // } // $bean = new GoodsSearchParamBean( // [] // ); // $data = DuoDuoKeUtil::goodsSearch($bean); // // //获取到goods_sign // $goods_sign = $data["goods_search_response"]["goods_list"][0]["goods_sign"]; // $beanData = [ // "p_id"=>"23985775_220860321", // "goods_sign_list"=>json_encode([$goods_sign]), // ]; // // $generateBean = new GoodsPromotionUrlGenerateParamBean($beanData); // $res = DuoDuoKeUtil::goodsPromotionUrlGenerate($generateBean); // return $this->success($data); // $params = [ // "goodsSign"=>"134221771214" // ]; // $bean = new GoodsDetailParamBean($params); // $data = DuoDuoKeUtil::goodsDetail($bean); // dd($data); // $url="https://mobile.yangkeduo.com/goods.html?_wvx=10&refer_share_uid=3669222324&share_uin=QKZTKYYF4LYNCB7SVBSL42IYWY_GEXDA&page_from=35&_wv=41729&refer_share_channel=copy_link&refer_share_id=JH6kVhnKqN5NIuAIRfb9tmkmfyyWR8yF&share_uid=3669222324&pxq_secret_key=MQRO6DTQJ7RNUNBUJLWQXGXIUHVHKISZRWVIGNWUVQXV7P74HXDA&goods_id=134221771214"; // $res = preg_match("/goods_id=(.*)/",$url,$match); // if($res){ // dd($match); // } // JutuikeUtil::transferGoodsLink($url); // $app = WechatAccountUtil::getApp("fanbuting"); // return $this->success($app->qrcode->forever(12)); // $data = JutuikeUtil::getActList(); // $data = JutuikeUtil::transferAct(123,3); // $data = JutuikeUtil::getOrderList(new GetOrderListParamBean()); // return $this->success($data); // $url = "https://mobile.yangkeduo.com/goods2.html?_wvx=10&refer_share_uid=3669222324&share_uin=QKZTKYYF4LYNCB7SVBSL42IYWY_GEXDA&page_from=35&_wv=41729&refer_share_channel=copy_link&refer_share_id=ukvmmxZsICNVPodwgxOlWhD7cckCuUr4&share_uid=3669222324&pxq_secret_key=ZFW7YES6N7KIXS7XW4JZD6YGTK3VLAAPTC3RDW2BI45OMMQGCZPA&goods_id=266346895187"; // $res = preg_match("/https\:\/\/mobile\.yangkeduo\.com/",$url,$match); // $data = DuoDuoKeUtil::goodsZsUnitUrlGen("23985775_219021997",$url); // dd($data); // $bean = new GetOrderSearchParamBean( // [ // "startTimestamp"=>time()-20*60, // "endTimestamp"=>time() // ] // ); // $data = MiniprogrameLianMengUtil::getOrderSearch($bean); // $bean = new GetProductListParamBean( // [ // "from"=>0, // "limit"=>10, // "sortType"=>1 // ] // ); // $data = MiniprogrameLianMengUtil::getProductList($bean); // $bean = new GetProductGenerateParamBean( // [ // "pid"=>"olIhv5Owrbf3EbOPjddpY8B5XR7Q_871679398", // "productList"=>[ // [ // "productId"=>"38133489", // "appId"=>"wxf565e2dfa175c3fa" // ] // ] // ] // ); // $data = MiniprogrameLianMengUtil::getProductGenerate($bean); // $data = MiniprogrameLianMengUtil::addPromotion("测试推广位"); // $data = MiniprogrameLianMengUtil::getPromotionList(0,10); // $data = DdkDaogouService::goodsPidGenerate(1); // $pdd_sid = "23985775_216467151"; // $bean = new ResourceUrlGenParamBean( // [ // "pid"=>$pdd_sid, // "resourceType"=>39997 // ] // ); // $data = DdkDaogouService::resourceUrlGen($bean); // $data = DianYingUtil::getDianYingActUrl(123); // $data =date("m月d日"); // $data = TaobaoLianMengUtil::getActivityInfo("111538400047","20150318020002597"); // $data = MeituanLianmengUtil::generateLink(22,"ceshi",MeiTuanLinkTypeEnum::MINIPROGRAME,env("MEITUAN_LIANMENG_KEY")); // $data = WechatAccountModel::findByWechatAppCode("fanbuting"); return $data; } }