<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # RESTful接口設計 ## REST控制器核心基類 繼承 Rest 控制器即可 使用 * 自動把GET,POST,PUT,DELETE 映射到 對應的Action 如getdetail 映射到GET\_detailAction() * 自動綁定參數id * 自動輸出json格式數據 代碼演示: ~~~php class IndexController extends Rest { /** * GET /Index/index?data='' * GET請求測試 * * success() 和 fail() 快速返回示例 */ public function GET_indexAction() { //這是一個用戶查詢例子 $uid = input('uid'); //簡單的模型調用 $user_model = new UserModel(); $userInfo = $user_model->getUserInfo($uid); } /** * POST /Index/addUser * POST請求測試 * * response()函數自定義狀態 */ public function POST_addUserAction() { $where['username'] = input('username'); $where['password'] = input('password'); //數據驗證 $video_validate = new \validate\User(); //采用場景驗證 if (!$video_validate->scene('add')->check($where)) { $this->fail($video_validate->getError()); } //簡單的模型調用 $user_model = new UserModel(); if ($user_model->add($where)) { $this->success(); } $this->fail(); } } ~~~ $this->success() 快速返回成功 $this->fail() 快速返回錯誤 $this->response(); 設置響應狀態 可以參考github代碼里的案例
                  <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>

                              哎呀哎呀视频在线观看