gq hace 8 años
padre
commit
9f616f6241
Se han modificado 1 ficheros con 28 adiciones y 18 borrados
  1. 28 18
      server/app/Http/Controllers/Api/V1/MyController.php

+ 28 - 18
server/app/Http/Controllers/Api/V1/MyController.php

xqd xqd xqd
@@ -132,22 +132,32 @@ class MyController extends Controller
      *  "status": true,
      *   "status_code": 0,
      *   "message": "",
-     *   "data": {
-     *       "emotion": [
-     *          {
-     *              "value": "1",
-     *              "name": "未婚"
-     *          },
-     *          ...
-     *      ],
-     *      "sex": [
-     *          {
-     *              "value": "0",
-     *              "name": "男"
-     *           },
-     *          ...
-     *      ]
-     *   }
+        "data": {
+            "emotion": [
+                {
+                    "value": "1",
+                    "name": "未婚"
+                },
+                {
+                    "value": "2",
+                    "name": "已婚"
+                },
+                {
+                    "value": "3",
+                    "name": "离异"
+                }
+            ],
+            "sex": [
+                {
+                    "value": "0",
+                    "name": "男"
+                },
+                {
+                    "value": "1",
+                    "name": "女"
+                }
+            ]
+        }
      * }
      * @apiErrorExample {json} Error-Response:
      * HTTP/1.1 400 Bad Request
@@ -203,7 +213,7 @@ class MyController extends Controller
         $user = $this->getUser();
         $data = $request->except('_token');
         $ok =  $user->update($data);
-        if ($ok) {
+        if ($ok == true) {
             return $this->api('');
         }else{
             return $this->error(ErrorCode::SAVE_USER_FAILED);
@@ -394,7 +404,7 @@ class MyController extends Controller
      *           "id": 2,
      *            "dream": "去旅游去旅游2",
      *           "about": "欧冠胡234",
-     *            "dream_pic": "aaaaa",
+     *            "dream_pic": "aaaaa",      封面图片
      *            "progress": 0,  进度
      *        ]
      *     }