PHP code example of misscx / api-doc

1. Go to this page and download the library: Download misscx/api-doc library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

misscx / api-doc example snippets



namespace app\controller;

use think\facade\Request;

/**
 * @title 测试demo
 * @description 接口说明
 * @group 接口分组
 * @header name:key scription 接口说明
     * @author 开发者
     * @url /demo
     * @method POST
     *
     * @header name:device 象信息@!
     * @object attribute1:对象属性1 attribute2:对象属性2
     * @return array:数组值#
     * @return list_user:用户列表@
     * @list_user name:名称 mobile:手机号 list_follow:关注列表@
     * @list_follow user_id:用户id name:名称
     */
    public function index()
    {
        //接口代码
        $header = Request::header();
        $data = Request::request();
        return json(["code"=>200, "message"=>"success", "data"=>['header'=>$header,'data'=>$data]]);
    }

    /**
     * @title 登录接口
     * @description 接口说明
     * @author 开发者
     * @url /demo/login
     * @method GET
     * @module 用户模块

     * @param name:name type:int