mark 2 år sedan
förälder
incheckning
c6c4bd99b0
3 ändrade filer med 80 tillägg och 4 borttagningar
  1. 40 4
      app/Http/Controllers/Home/HomeController.php
  2. 39 0
      public/swagger.json
  3. 1 0
      routes/api.php

+ 40 - 4
app/Http/Controllers/Home/HomeController.php

@@ -147,13 +147,49 @@ class HomeController extends BaseController
     }
 
     /**
-     * @param $userId
-     * @param $actId
+     * @SWG\Get(
+     *     path="/transfer/25/1",
+     *     tags={"首页管理"},
+     *     summary="获取返利链接接口",
+     *     description="获取返利链接接口",
+     *     produces={"application/json"},
+     *     @SWG\Response(
+     *         response="200",
+     *         description="success",
+     *          @SWG\Schema(
+     *              @SWG\Property(
+     *                  property="type",
+     *                  type="string",
+     *                  description="类型(1 h5 2小程序)"
+     *              ),
+     *              @SWG\Property(
+     *                  property="url",
+     *                  type="string",
+     *                  description="链接或者小程序首页"
+     *              ),
+     *              @SWG\Property(
+     *                  property="app_id",
+     *                  type="string",
+     *                  description="小程序appID"
+     *              )
+     *          )
+     *     ),
+     *     @SWG\Response(
+     *         response="403",
+     *         description="fail",
+     *         @SWG\Schema(ref="#/definitions/ErrorBean")
+     *     )
+     * )
      */
-    public static function getTransferLinkurl($userId, $actId)
+    public function getTransferLinkurl($userId, $actId)
     {
 //        dd(request()->getHost());
         $url = HomeLogic::getTransferLink($actId,$userId);
-        return redirect($url);
+        $data = [
+            "type"=>1,
+            "url"=>$url,
+            "app_id"=>""
+        ];
+        return $this->success($data);
     }
 }

+ 39 - 0
public/swagger.json

@@ -140,6 +140,45 @@
                 }
             }
         },
+        "/transfer/25/1": {
+            "get": {
+                "tags": [
+                    "\u9996\u9875\u7ba1\u7406"
+                ],
+                "summary": "\u83b7\u53d6\u8fd4\u5229\u94fe\u63a5\u63a5\u53e3",
+                "description": "\u83b7\u53d6\u8fd4\u5229\u94fe\u63a5\u63a5\u53e3",
+                "produces": [
+                    "application/json"
+                ],
+                "responses": {
+                    "200": {
+                        "description": "success",
+                        "schema": {
+                            "properties": {
+                                "type": {
+                                    "description": "\u7c7b\u578b(1 h5 2\u5c0f\u7a0b\u5e8f)",
+                                    "type": "string"
+                                },
+                                "url": {
+                                    "description": "\u94fe\u63a5\u6216\u8005\u5c0f\u7a0b\u5e8f\u9996\u9875",
+                                    "type": "string"
+                                },
+                                "app_id": {
+                                    "description": "\u5c0f\u7a0b\u5e8fappID",
+                                    "type": "string"
+                                }
+                            }
+                        }
+                    },
+                    "403": {
+                        "description": "fail",
+                        "schema": {
+                            "$ref": "#/definitions/ErrorBean"
+                        }
+                    }
+                }
+            }
+        },
         "/order/list": {
             "post": {
                 "tags": [

+ 1 - 0
routes/api.php

@@ -70,6 +70,7 @@ Route::prefix("user")->namespace("User")->middleware(["checkAuth"])->group(funct
     Route::get("recommend/url","UserController@getRecommendUrl");
 });
 
+
 //订单管理
 Route::prefix("order")->namespace("Order")->middleware(["checkAuth"])->group(function (){
     //获取订单列表接口