gq 8 年之前
父节点
当前提交
8b63f07def

+ 2 - 0
.gitignore

xqd
@@ -16,6 +16,8 @@ node_modules
 /server/storage/framework/views
 /server/storage/framework/sessions
 /server/public/upload
+server/public/apidoc/
 
 miaomiao/miaomiao/platforms/android/.gradle/2.2.1/taskArtifacts/cache.properties.lock
 miaomiao/miaomiao/platforms/android/.gradle/2.2.1/taskArtifacts/fileHashes.bin
+

+ 7 - 0
server/apidoc.json

xqd
@@ -0,0 +1,7 @@
+{
+  "name": "MiaoMiao",
+  "version": "0.1.0",
+  "description": "MiaoMiao",
+  "title": "MiaoMiao",
+  "url" : "http://w21.9026.com"
+}

+ 5 - 1
server/app/Http/Controllers/Api/V1/IndexController.php

xqd xqd
@@ -11,6 +11,11 @@ class IndexController extends Controller
 {
     /**
      * @api {get} /api/home/hot 热门(hot)
+     * @apiDescription 登陆(hot)
+     * @apiGroup Index
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {string}  phone   手机号码
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
      * {
@@ -32,7 +37,6 @@ class IndexController extends Controller
      * 可能出现的错误代码:
      *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
      */
-
     public function hot(Request $request)
     {
         $user = $this->getUser();

+ 52 - 41
server/app/Http/Controllers/Api/V1/MyController.php

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -12,38 +12,49 @@ class MyController extends Controller
 {
     /**
      * @api {get} /api/my/index 个人首页(index)
+     * @apiDescription 个人首页(index)
+     * @apiGroup My
+     * @apiPermission Passport
      * @apiSuccessExample {json} Success-Response:
-     * HTTP/1.1 200 OK
-    {
-    "status": true,
-    "status_code": 0,
-    "message": "",
-    "data": {
-    "my_care_num": 4,关注
-    "my_fens_num": 3,粉丝
-    "my_collection_num": 2,收藏
-    "my_dream_num": 1,发帖
-    "user": {
-    "id": 1,
-    "tel": "13880642880",
-    "password": "",
-    "nickname": "",
-    "pic": "",
-    "sign": 0,
-    "money": 0,余额
-    "sex": 1,
-    "signture": "",个性签名
-    "tall": "",
-    "job": "",
-    "emotion": 1,
-    "address": "",
-    "detail_address": "",
-    "status": 1,
-    "remember_token": "",
-    "created_at": "2017-06-02 02:30:12",
-    "updated_at": "2017-06-02 02:30:12",
-    "deleted_at": null,
-    }
+     * HTTP/1.1 200 O*  "status": true,
+     *  "status_code": 0,
+     *  "message": "",
+     *  "data": {
+     *  "my_care_num": 4,关注
+     *  "my_fens_num": 3,粉丝
+     *  "my_collection_num": 2,收藏
+     *  "my_dream_num": 1,发帖
+     *  "user": {
+     *  "id": 1,
+     *  "tel": "13880642880",
+     *  "password": "",
+     *  "nickname": "",
+     *  "pic": "",
+     *  "sign": 0,
+     *  "money": 0,余额
+     *  "sex": 1,
+     *  "signture": "",个性签名
+     *  "tall": "",
+     *  "job": "",
+     *  "emotion": 1,
+     *  "address": "",
+     *  "detail_address": "",
+     *  "status": 1,
+     *  "remember_token": "",
+     *  "created_at": "2017-06-02 02:30:12",
+     *  "updated_at": "2017-06-02 02:30:12",
+     *  "deleted_at": null,
+     *  }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     *{
+     *"status": true,
+     *"status_code": 0,
+     *"message": "",
+     *"data": {
+     *"user": null
+     * }
+     *}
      */
     public function index()
     {
@@ -66,7 +77,7 @@ class MyController extends Controller
     /**
      * @api {get} /api/my/persona 个人信息(persona)
      * @apiDescription 个人信息(persona)
-     * @apiGroup Auth
+     * @apiGroup My
      * @apiPermission Passport
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:
@@ -110,7 +121,7 @@ class MyController extends Controller
     /**
      * @api {get} /api/my/recharge 充值(recharge)
      * @apiDescription 充值(recharge)
-     * @apiGroup Auth
+     * @apiGroup My
      * @apiPermission Passport
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:
@@ -127,7 +138,7 @@ class MyController extends Controller
     /**
      * @api {get} /api/my/system_info 系统消息(systemInfo)
      * @apiDescription 系统消息(systemInfo)
-     * @apiGroup Auth
+     * @apiGroup My
      * @apiPermission Passport
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:
@@ -165,7 +176,7 @@ class MyController extends Controller
     /**
      * @api {get} /api/my/reply_my 回复我的(replyMy)
      * @apiDescription 回复我的(replyMy)
-     * @apiGroup Auth
+     * @apiGroup My
      * @apiPermission Passport
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:
@@ -227,7 +238,7 @@ class MyController extends Controller
     /**
      * @api {post} /api/my/my_reply 我的回复(myReply)
      * @apiDescription 我的回复(recharge)
-     * @apiGroup Auth
+     * @apiGroup My
      * @apiParam {text}  content   回复内容
      * @apiParam {int} comment_id   评论ID
      * @apiPermission Passport
@@ -276,7 +287,7 @@ class MyController extends Controller
     /**
      * @api {get} /api/my/dream 我的梦想(dream)
      * @apiDescription 我的梦想(recharge)
-     * @apiGroup Auth
+     * @apiGroup My
      * @apiPermission Passport
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:
@@ -319,7 +330,7 @@ class MyController extends Controller
     /**
      * @api {get} /api/my/collection 我的收藏(collection)
      * @apiDescription 我的收藏(recharge)
-     * @apiGroup Auth
+     * @apiGroup My
      * @apiPermission Passport
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:
@@ -336,7 +347,7 @@ class MyController extends Controller
     /**
      * @api {get} /api/my/setting 设置(setting)
      * @apiDescription 设置(setting)
-     * @apiGroup Auth
+     * @apiGroup My
      * @apiPermission Passport
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:
@@ -357,7 +368,7 @@ class MyController extends Controller
        * @apiParam {string}  dream   梦想标题
        * @apiParam {string}  about   梦想介绍
        * @apiParam {int}  money   梦想币
-     * @apiGroup Auth
+     * @apiGroup My
      * @apiPermission Passport
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:
@@ -433,7 +444,7 @@ class MyController extends Controller
     /**
      * @api {get} /api/my/dream_about 梦想介绍(dreamAbout)
      * @apiDescription 梦想介绍(dreamAbout)
-     * @apiGroup Auth
+     * @apiGroup My
      * @apiPermission Passport
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:

+ 4 - 0
server/readme.md

xqd
@@ -9,6 +9,10 @@
 - 执行 `php artisan db:seed`
 - 键入 '域名/admin/login'(后台登录)
 
+
+- 生成文档 apidoc -i app/Http/Controllers/Api/V1 -o public/apidoc
+- api文档在public/apidoc里面, 也可以看上面的 `在线api文档`
+
 ####注意第一次安装的时候要