php apidoc產生介面文檔樣本

來源:互聯網
上載者:User

api 產生介面文檔樣本:

{

  "name": "9月份贈險領取分享活動微信介面",

  "version": "1.0.0",

  "description": "9月份贈險領取分享活動微信介面文檔 (t=1) ",

  "sampleUrl" : "http://www.phpernote.com/"

}

另存檔案名稱為:apidoc.json

apidoc -i 要產生文檔的項目目錄 -o 介面檔案的組建目錄

介面代碼檔案代碼如下:

<?php
/**
 * @api {post} /news/lists 新聞資訊列表
 * @apiVersion 1.0.0
 * @apiName lists
 * @apiGroup User
 * @apiPermission 登入使用者
 *
 * @apiDescription 使用者登入後進入該頁面,將顯示新聞資訊列表
 *
 * @apiSampleRequest /v1/news/lists
 *
 * @apiSuccess (傳回值) {string} id 主鍵ID
 * @apiSuccess (傳回值) {string} name 客戶姓名
 * @apiSuccess (傳回值) {string} user_head_img 客戶頭像
 * @apiSuccess (傳回值) {integer} sex 性別:0-未設定,1-男,2-女
 * @apiSuccess (傳回值) {string} demand 客戶需求
 *
 * @apiSuccessExample {json} 成功樣本:
 * {"code": 1,"msg": "","data": {"id": "57b3cdb46b787","name": "餘浩苗","user_head_img": "userHead/2016-08-18/1034587522576.jpg","sex": "1","demand": "本人想買保險,請速聯絡!"}}
 *
 * @apiErrorExample (json) 錯誤樣本:
 *     {"code":-1,"msg":"密碼錯誤","data":{}}
 */

///////////////////////////////////////

/**
 * @api {post} /news/rob 搶客戶
 * @apiVersion 1.0.0
 * @apiName rob
 * @apiGroup User
 * @apiPermission 登入使用者
 *
 * @apiDescription 搶客戶
 *
 * @apiParam {string} id 主鍵ID
 *
 * @apiSampleRequest /v1/news/rob
 *
 * @apiSuccessExample {json} 成功樣本:
 * {"code":1,"msg":"","data":{}}
 *
 * @apiErrorExample (json) 錯誤樣本:
 *     {"code":-1,"msg":"錯誤資訊","data":{}}
 */

///////////////////////////////////////
更多關於apidoc的用法請參考:http://apidocjs.com/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.