123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- <?php
- namespace App\Http\Controllers;
- use App\Exceptions\ValidateException;
- use App\Http\Bean\Util\Jutuike\GetOrderListParamBean;
- use App\Http\Bean\Util\Pdd\Ddk\GoodsDetailParamBean;
- use App\Http\Bean\Util\Pdd\Ddk\GoodsPromotionUrlGenerateParamBean;
- use App\Http\Bean\Util\Pdd\Ddk\GoodsSearchParamBean;
- use App\Http\Bean\Util\Wechat\Miniprograme\GetOrderSearchParamBean;
- use App\Http\Bean\Util\Wechat\Miniprograme\GetProductGenerateParamBean;
- use App\Http\Bean\Util\Wechat\Miniprograme\GetProductListParamBean;
- use App\Http\Enum\MeiTuanLinkTypeEnum;
- use App\Http\Utils\BaseUtil;
- use App\Http\Utils\DianYing\DianYingUtil;
- use App\Http\Utils\Jutuike\JutuikeUtil;
- use App\Http\Utils\KenDeJi\KenDeJiUtil;
- use App\Http\Utils\McDonalds\McDonaldsUtil;
- use App\Http\Utils\Meituan\MeituanLianmengUtil;
- use App\Http\Utils\Pdd\DuoDuoKeUtil;
- use App\Http\Utils\TaoBao\TaobaoLianMengUtil;
- use App\Http\Utils\Wechat\Miniprograme\MiniprogrameLianMengUtil;
- use App\Http\Utils\WechatAccountUtil;
- use App\Models\WechatAccountModel;
- use EasyWeChat\Kernel\Messages\Image;
- use Illuminate\Http\Request;
- use Tool\ShanTaoTool\Bean\Pdd\Ddk\ResourceUrlGenParamBean;
- use Tool\ShanTaoTool\Pdd\Ddk\DdkDaogouService;
- class BaseController extends Controller
- {
-
- public function __construct(Request $request)
- {
-
-
- $controllerName = $request->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);
- }
- }
- }
- }
-
- public function success($data = [], $code = 200, $msg = "", $url = "")
- {
- return response()->json(
- [
- "status"=>true,
- "data"=>$data,
- "code"=>$code,
- "msg"=>$msg,
- "url"=>$url
- ]
- );
- }
-
- public function error($msg,$code="500",$url="")
- {
- return response()->json(
- [
- "status"=>false,
- "data"=>"",
- "code"=>$code,
- "msg"=>$msg,
- "url"=>$url
- ]
- );
- }
-
- public function swagger()
- {
- $swagger=\Swagger\scan(__DIR__."/../");
- $swagger->saveAs('./swagger.json');
- return $this->success();
- }
-
- public function loadSwagger()
- {
- $data = json_decode(file_get_contents("./swagger.json"),true);
- return $data;
- }
- public function test()
- {
- TaobaoLianMengUtil::taokoulingConvert("89!就心也对他可大能们后小哈 https://m.tb.cn/h.fgXlN6a?sm=3efae5 儿童过家家小医生玩具套装仿真医疗箱女孩护士打针男孩听诊器工具");
-
- $data = JutuikeUtil::convert("551557489590","jtkupstream21");
- dd($data);
-
- return $data;
- }
- }
|