gq 7 years ago
parent
commit
e63b6731fd

+ 2 - 0
server/app/Http/Controllers/Api/V1/InteractionController.php

xqd xqd
@@ -20,6 +20,7 @@ class InteractionController extends Controller
      * @apiVersion 0.1.0
      * @apiParam {int} id                 梦想ID
      * @apiParam {string} title           互动标题
+     * @apiParam {string} [video]           视频
      * @apiParam {array} pics[]           图片数组
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
@@ -66,6 +67,7 @@ class InteractionController extends Controller
         $title = $request->title;
         $data['dream_id'] = $dream_id;
         $data['title'] = $title;
+        $data['video'] = $request->video;
         $ok = InteractionInfo::create($data);
         if ($ok) {
 //            收藏梦想最新动态加一

+ 32 - 0
server/database/migrations/2017_08_29_180011_add_video_to_interaction_info_table.php

xqd
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddVideoToInteractionInfoTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('interaction_info', function (Blueprint $table) {
+            $table->string('video')->comment('动态视频地址')->nullable()->after('title');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('interaction_info', function (Blueprint $table) {
+            //
+        });
+    }
+}