Showdoc usage - interface documentation

1. Go to the official showdoc account

The official address is https://www.showdoc.com.cn/
to log in and create a project, as shown in the figure:

img

2. Download the showdoc environment

There is a development api in the project settings, click on the following:

img

Among them is the official tutorial, which is simple and comprehensive. The basis of showdoc is to use the official script
https://git-scm.com/download/win domestic: these are officially recommended by showdoc, first install git and then download the showdoc script.

3. Configuration

After the above environment and script are installed, put the script in the directory where the interface document needs to be generated, and edit:
api_key, api_token, url three attributes, api_key and api_token can be copied and pasted in the above project settings, url The default is url=https://www.showdoc.com.cn/server/?s=/api/open/fromComments , but if you use the open source version of showdoc, you need to change the address to http://xx.com/ server/index.php?s=/api/open/fromComments , otherwise no modification is required.

4. Operation

First write a comment on the header of the interface, refer to:
/**
* showdoc
* @catalog test document/user related
* @title user login
* @description user login interface
* @method get
* @url https://www.showdoc .cc/home/user/login
* @header token optional string device token
* @param username required string username
* @param password required string password
* @param name optional string user nickname
* @return {"error_code" :0,"data":{"uid":"1","username":"12154545","name":"Wu Xiehang","groupid":2,"reg_time":"1436864169","last_login_time ":"0"}}
* @return_param groupid int user group id
* @return_param name string user nickname
* @remark here is remark information
* @number 99
*/
Then run the shoudoc script, and then you can showdoc workbench items by yourself I saw the interface in the example:

insert image description here

Guess you like

Origin blog.csdn.net/qq_43842093/article/details/123192822