<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## Parameter請求類型 參數`@SWG\Parameter()`是配合``@SWG\Post()``,``@SWG\Get()``,``@SWG\Delete()``,``@SWG\Put()``使用設置請求參數的。 ``` /* @SWG\Post( * path="/index/register/index", * tags={"用戶相關"}, * summary="用戶注冊", * @SWG\Parameter( * in="formData", * required=false, * name="simg", * type="file", * format="string", * description="description", * ), * / ``` | 參數 |含義 | | --- | --- | | ref | 允許此路徑項的外部定義 | | in | 參數的位置,可設置的值為“query”、“header”、“path”、“formData”或“body” | | description | 描述 | | required | 確定此參數是否是必需的值可設置的值為 true 或 false | | type | 參數的類型,可設置值是“string”、“number”、“integer”、“boolean”、“array”或“file” | | format | 類型的擴展格式 | | items | 描述Array上的項目類型 | | collectionFormat | 數組的格式, | | default |設置參數的默認值。值的類型取決于定義的類型 | | maximum |最大長度 | | maximum |最小長度 | 下面我們來說下該怎么使用的`@SWG\Parameter()`里面的參數: > 當我們把```in```設置為“query”、“header”、“path”、“formData” > 示例: ``` /* @SWG\Post( * path="/index/register/index", * tags={"用戶相關"}, * summary="用戶注冊", * @SWG\Parameter( * in="formData", * required=false, * name="simg", * type="file", * format="string", * description="description", * ), * @SWG\Parameter( * in="formData", * name="num", * type="integer", * maximum="10", * ), * @SWG\Response(response="200",description="ok") * * ), * / ``` > 需要注意的是參數`items`和 `collectionFormat` 只有參數type=“array”才使用: ``` /** @SWG\Parameter( * in="formData", * name="ids", * type="array", * items={"type","string"}, * collectionFormat="multi" * ), * */ ``` > 參數`collectionFormat` 是數組傳遞到API接口值得格式:csv-逗號分隔值、ssv-空格分隔值、tsv 以“%09”分隔值、pipes以“|”分隔值 、multi如果`in`選擇”query“正常接收就好,如果選擇“formdata”逗號分隔值 > 當參數 `in`選擇“body”時必須定義`@SWG\Schema()`或`schema`,通過`@SWG\Schema()`自定義一個JSON > ``` /* * @SWG\Post( * path="/index/index/regiser", * tags={"用戶相關"}, * summary="用戶注冊", * consumes={"application/json"}, * produces={"application/json"}, * @SWG\Parameter( * in="body", * required=true, * name="body", * description="description", * @SWG\Schema( * @SWG\Property( * property="firstName", * type="string", * ), * @SWG\Property( * property="lastName", * type="string" * ), * @SWG\Property( * property="username", * type="string" * ) * ), * ), * @SWG\Response(response="200",description="ok",) * ) */ ``` > 關于`@SWG\Schema()`的相關介紹可以查看Schema參數說明
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看