| xqd
@@ -1627,4 +1627,40 @@ class MyController extends Controller
|
|
|
return $this->api($data);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @api {post} /api/my/step 新手引导
|
|
|
+ * @apiDescription 新手引导
|
|
|
+ * @apiGroup My
|
|
|
+ * @apiPermission Passport
|
|
|
+ * @apiVersion 0.1.0
|
|
|
+ * @apiSuccessExample {json} Success-Response:
|
|
|
+ * HTTP/1.1 200 OK
|
|
|
+ *{
|
|
|
+ * "status": true,
|
|
|
+ * "status_code": 0,
|
|
|
+ * "message": "",
|
|
|
+ * "data": ""
|
|
|
+ * 如果step的值等于5表示已完成新手引导不用调用此接口
|
|
|
+ * 可根据step的值判断用户新手引导到第几步
|
|
|
+ *}
|
|
|
+ * @apiErrorExample {json} Error-Response:
|
|
|
+ *{
|
|
|
+ * "status": false,
|
|
|
+ * "status_code": 700,
|
|
|
+ * "message": "操作失败",
|
|
|
+ * "data": null
|
|
|
+ *}
|
|
|
+ * HTTP/1.1 400 Bad Request
|
|
|
+ */
|
|
|
+ public function step(Request $request)
|
|
|
+ {
|
|
|
+ $user = $this->getUser();
|
|
|
+ if($user->step<5) { //新手引导一共5步
|
|
|
+ $user->step += 1;
|
|
|
+ $ok = $user->save();
|
|
|
+ if($ok) return $this->api('');
|
|
|
+ }
|
|
|
+ return $this->error(ErrorCode::OPERATION_FAILED);
|
|
|
+ }
|
|
|
+
|
|
|
}
|