<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                在一個正常的開發流程中,開發流程往往是這樣的: 1. 前臺所有原型開發(全部)。 2. 前臺UML圖開發, 后臺UML圖開發。 3. 根據前臺UML圖,制定開發規范(按模塊分步開發)。 4. 按開發規范,開發后臺(按模塊分步開發)。 5. 開發前臺M層,按規范與后臺對接(按模塊分步開發)。 我們往往會按項目需求制定開發規范。 所以,一般不會出現上一章節中,需要手工建立json文件的情況。同樣,我們已假設開發至此,已經制定好如下規范, 并且后臺人員已經按規范已經開發好了接口。 # 開發規范 ## /Teacher_all 教師列表 ## URL: http://www.mengyunzhi.com:8080/javaee/Teacher_all.json ## 請求格式 json ## HTTP請求方式 GET ## 是否需要登錄 是 ## 請求參數 <table> <tr> <th></th> <th>必選</th> <th>類型及范圍</th> <th>說明</th> </tr> </table> ## 注意事項 返回值中,包括teacher信息. ## 返回結果 json示例: ``` { "code": 200, "teachers": [ { "email": "lisi@yunzhiclub.com", "id": 1, "name": "李四", "password": "234", "sex": false, "teacherId": 1, "username": "lisi" }, { "email": "wangwu@yunzhiclub.com", "id": 2, "name": "王五", "password": "234", "sex": false, "teacherId": 2, "username": "wangwu" } ] } ``` ## 返回字段說明 <table> <tr> <th>返回字段</th> <th>字段類型</th> <th>說明</th> </tr> <tr> <td>code</td> <td>int</td> <td>200正常;401:用戶未登陸; 403:用戶無權限</td> </tr> <tr> <td>teachers</td> <td>array</td> <td>教師列表(包含有teacher信息)</td> </tr> </table> # 重構代碼 現在,我們正式將前臺中的url寫入正式的信息 app/scripts/services/teacher.js ``` ... // 獲取所有教師 var all = function(callback) { // $http.get().then(function1(){}, function2(){}); 鏈式調用 then()中接收兩個參數,類型均為function $http.get('http://www.mengyunzhi.com:8080/javaee/Teacher_all.json').then(function success(response) { // 數據成功返回 console.log(response); var teachers = response.data.teachers; callback(teachers); }, function error(response) { console.log('數據請求錯誤:'); console.log(response); }); }; ... ``` # 測試 此時,我們刷新 [http://localhost:9000/#!/teacher/](http://localhost:9000/#!/teacher/), 打開控制臺,并注意網絡選項卡,如果數據成功返回的話,相信你已經能看到數據表中的數據了。
                  <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>

                              哎呀哎呀视频在线观看