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

                - 交互數據見`cn.exrick.xboot.common.vo.Result`實體類 | 數據 | 類型 | 說明 | | --- | --- | --- | | success | Boolean | 前后端交互標識,成功返回true,錯誤返回false(大部分情況前端僅需處理返回成功true的情況,錯誤異常提示已根據code統一處理) | | message | String | 消息 | | code | Integer | 自定義交互碼,已封裝處理錯誤401、403、500,可自定義返回單獨處理消息 | | timestamp | Long | 時間戳 | | result | 泛型 | 返回數據結果 | - 封裝工具類`cn.exrick.xboot.common.utils.ResultUtil`,當然你還可以自定義其他方法 | 實例方法 | 返回result | 返回message | 返回success | 返回code | | --- | --- | --- | --- | --- | | setData(T t) | 傳入參數t | success | true | 200 | | setSuccessMsg(String msg) | null | 傳入參數msg | true | 200 | | setData(T t, String msg) | 傳入參數t | 傳入參數msg | true | 200 | | setErrorMsg(String msg) | null | 傳入參數msg | false | 500 | | setErrorMsg(Integer code, String msg) | null | 傳入參數msg | false | 傳入參數code | > 現已新增提供再次封裝的靜態方法 | 靜態方法 | 返回result | 返回message | 返回success | 返回code | | --- | --- | --- | --- | --- | | data(T t) | 傳入參數t | success | true | 200 | | success() | null | success | true | 200 | | success(String msg) | null | 傳入參數msg | true | 200 | | data(T t, String msg) | 傳入參數t | 傳入參數msg | true | 200 | | error(String msg) | null | 傳入參數msg | false | 500 | | error(Integer code, String msg) | null | 傳入參數msg | false | 傳入參數code | - 使用示例 ~~~ // Result<T>中的泛型T指定對象后,生成的接口文檔中將顯示該傳入的數據結構,對文檔更加友好 public Result<Object> getData() { return new ResultUtil<Object>().setData("你的數據"); } // 也可省略泛型 public Result getData() { return new ResultUtil<>().setSuccessMsg("操作成功"); } public Result<Object> getData() { return new ResultUtil<Object>().setData("你的數據", "操作成功"); } public Result<Object> getData() { return new ResultUtil<Object>().setErrorMsg("錯誤消息"); } public Result<Object> getData() { return new ResultUtil<Object>().setErrorMsg(501, "錯誤消息"); } // 新靜態方法 public Result<Object> getData() { return ResultUtil.data("你的數據"); } // 也可省略泛型 public Result getData() { return ResultUtil.success(); } public Result getData() { return ResultUtil.success("操作成功"); } public Result getData() { return ResultUtil.success("你的數據", "操作成功"); } public Result getData() { return ResultUtil.error("錯誤消息"); } public Result getData() { return ResultUtil.error(501, "錯誤消息"); } ~~~
                  <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>

                              哎呀哎呀视频在线观看