HGthecode/apidoc-php

麻烦支持下data下可以被直接指向table,而不是必须存在key然后指向table

Closed this issue · 1 comments

aogg commented
        'responses' => [
            // 成功响应体
            'success' => [
                ['name' => 'code', 'desc' => '业务代码', 'type' => 'int', 'require' => 1],
                ['name' => 'message', 'desc' => '业务信息', 'type' => 'string', 'require' => 1],
                //参数同上 headers;main=true来指定接口Returned参数挂载节点
                ['name' => 'data', 'desc' => '业务数据', 'main' => true, 'type' => 'object', 'require' => 1],
            ],

Apidoc\Returned这个name参数可以不填,反正要table直接放在data上,而不是data.data来获取到table

    #[
        Apidoc\Title("详情"),
        Apidoc\Method("GET"),
        Apidoc\Tag("已完成"),
        Apidoc\Param(name: "id", type: "integer", require: true, default: "", desc: "详情id"),
        Apidoc\Returned("",type:"array",table:"line_material",desc:"详情", replaceGlobal: true),

    ]

aogg commented

\hg\apidoc\annotation\Returned(table:"line_speech_cate"),