Example of API Doc generation
Api generation interface document example:
{"Name": "interface for getting free risks in January", "version": "1.0.0", "description ": "September free to receive sharing activity interface documentation (t = 1)", "sampleUrl": "http://www.phpernote.com /"}
Saved file name: apidoc. json
Apidoc-I project directory for document generation-o interface file generation directory
The code of the interface code file is as follows:
<? Php/*** @ api {post}/news/lists news information list * @ apiVersion 1.0.0 * @ apiName lists * @ apiGroup User * @ apiPermission Login User ** @ apide.pdf User Login and then enter the page, the news information list is displayed ** @ apiSampleRequest/v1/news/lists ** @ apiSuccess (Return Value) {string} id Primary Key ID * @ apiSuccess (return value) {string} name customer name * @ apiSuccess (Return Value) {string} user_head_img customer profile * @ apiSuccess (Return Value) {integer} sex Gender: 0-not set, 1-male, 2-female * @ apiSuccess (Return Value) {string} d Emand customer requirements ** @ apiSuccessExample {json} success example: * {"code": 1, "msg": "", "data": {"id ": "57b3cdb46b787", "name": "Cao", "user_head_img": "userHead/2016-08-18/1034587522576. jpg "," sex ":" 1 "," demand ":" I want to buy insurance. Please contact us quickly! "} ** @ ApiErrorExample (json) Error example: * {" code ":-1," msg ":" Incorrect password "," data ": {}}*//////////////////////////////////// //// *** @ api {post}/news/rob grabs customers * @ apiVersion 1.0.0 * @ apiName rob * @ apiGroup User * @ apiPermission Login User ** @ apide.pdf customer master ** @ apiParam {string} id Primary Key ID ** @ apiSampleRequest/v1/news/rob ** @ apiSuccessExample {json} success example: * {"code": 1, "msg": "", "data" :{}}** @ apiErrorExample (json) Error example: * {"code ": -1, "msg": "error message", "data ": {}}*//////////////////////////////////// ////