<ul id="qxxfc"><fieldset id="qxxfc"><tr id="qxxfc"></tr></fieldset></ul>

      系列目錄???? 【已更新最新開發(fā)文章,點擊查看詳細(xì)】
      <https://www.cnblogs.com/SavionZhang/p/11424431.html>
      本文詳細(xì)介紹如何獲取BIMFACE平臺中所有上傳過的文件信息列表。

      請求地址:GET https://file.bimface.com/files


      說明:根據(jù)多種查詢條件獲取文件詳細(xì)信息列表,支持分頁

      參數(shù):




      請求 path(示例):https://file.bimface.com/files

      請求 header(示例):"Authorization: Bearer dc671840-bacc-4dc5-a134-97c1918d664b"

      HTTP響應(yīng)示例(200):
      { "code" : "success", "data" : [ { "createTime" : "2017-11-09 13:25:03", "etag"
      :"19349858cjs98ericu989", "fileId" : 1216113551663296, "length" : 39044, "name"
      :"-1F.rvt", "status" : "success", "suffix" : "rvt" } ], "message" : "" }
      注意上面返回的data內(nèi)容是一個數(shù)組。

      C#實現(xiàn)方法:
      1 /// <summary> 2 /// 根據(jù)多種查詢條件獲取文件詳細(xì)信息列表,支持分頁 3 /// </summary> 4 ///
      <param name="accessToken">令牌</param> 5 /// <param name="startTime">起始日期,格式為
      yyyy-MM-dd。默認(rèn)為空,查詢所有</param> 6 /// <param name="endTime">截止日期,格式為
      yyyy-MM-dd。默認(rèn)為空,查詢所有</param> 7 /// <param name="rows">查詢結(jié)果數(shù), 默認(rèn)為100,
      最大500。默認(rèn)100</param> 8 /// <param name="offset">
      查詢結(jié)果偏移,從查詢結(jié)果的第offset條開始返回數(shù)據(jù)。默認(rèn)-1,查詢所有</param> 9 /// <param name="status">
      文件狀態(tài),uploading,success,failure。默認(rèn)為空,查詢所有</param> 10 /// <param name="suffix">
      文件后綴。默認(rèn)為空,查詢所有</param> 11 /// <returns></returns> 12 public virtual
      FileInfoListGetResponse GetFileInfoList(string accessToken, string startTime =
      "", string endTime = "", long rows = 100, long offset = -1, string status = "",
      string suffix = "") 13 { 14 FileInfoListGetResponse response = new
      FileInfoListGetResponse();15 16 #region 校驗 17 if (rows < 0 || rows > 500) 18 {
      19 response.Message = "參數(shù)[rows]超出范圍。要求控制在1到500之間!"; 20 21 return response; 22 }
      23 24 #endregion 25 26 //GET https://file.bimface.com/files 27 string url =
      BimfaceConstants.FILE_HOST +"/files"; 28 url = url + "?rows=" + rows; 29 if (!
      string.IsNullOrWhiteSpace(startTime)) 30 { 31 url = url + "?rows=" + rows; 32
      }33 if (!string.IsNullOrWhiteSpace(endTime)) 34 { 35 url = url + "?endTime=" +
      endTime;36 } 37 if (offset >= 0) 38 { 39 url = url + "?offset=" + offset; 40
      }41 if (!string.IsNullOrWhiteSpace(status)) 42 { 43 url = url + "?status=" +
      status;44 } 45 if (!string.IsNullOrWhiteSpace(suffix)) 46 { 47 url = url + "
      ?suffix=" + suffix; 48 } 49 50 BimFaceHttpHeaders headers = new
      BimFaceHttpHeaders();51 headers.AddOAuth2Header(accessToken); 52 53 try 54 {
      55 HttpManager httpManager = new HttpManager(headers); 56 HttpResult httpResult
      = httpManager.Get(url); 57 if (httpResult.Status == HttpResult.STATUS_SUCCESS)
      58 { 59 response =
      httpResult.Text.DeserializeJsonToObject<FileInfoListGetResponse>(); 60 } 61
      else 62 { 63 response = new FileInfoListGetResponse 64 { 65 Message =
      httpResult.RefText66 }; 67 } 68 69 return response; 70 } 71 catch (Exception
      ex)72 { 73 throw new Exception("[獲取文件信息列表]發(fā)生異常!", ex); 74 } 75 } 其中引用的
      httpManager.Get() 方法,請參考《C#開發(fā)BIMFACE系列6 服務(wù)端API之獲取文件信息》
      <https://www.cnblogs.com/SavionZhang/p/11433179.html>,方法完全一樣。 測試
      在BIMFACE的控制臺中可以看到我們上傳的文件列表,共計2個文件。



      下面通過調(diào)用上述的GetFileInfoList()方法來測試,結(jié)果如下,與后臺的文件列表一致。


      測試程序如下:
      // 獲取文件信息列表 protected void btnGetFileList_Click(object sender, EventArgs e) {
      txtFileInfo.Text= string.Empty; string token = txtAccessToken.Text; FileApi api
      =new FileApi(); FileInfoListGetResponse response = api.GetFileInfoList(token);
      List<FileInfoGetEntity> fileInfoList = response.Data; StringBuilder sbFiles =
      new StringBuilder(); foreach(FileInfoGetEntity fileInfo in fileInfoList) {
      sbFiles.AppendLine("名稱:" + fileInfo.ToString()); } txtFileInfo.Text =
      response.Code+ Environment.NewLine + response.Message + Environment.NewLine + "
      共獲取" + fileInfoList.Count + " 個文件。" + Environment.NewLine + sbFiles; } 系列目錄????
      【已更新最新開發(fā)文章,點擊查看詳細(xì)】 <https://www.cnblogs.com/SavionZhang/p/11424431.html>

      友情鏈接
      ioDraw流程圖
      API參考文檔
      OK工具箱
      云服務(wù)器優(yōu)惠
      阿里云優(yōu)惠券
      騰訊云優(yōu)惠券
      京東云優(yōu)惠券
      站點信息
      問題反饋
      郵箱:[email protected]
      QQ群:637538335
      關(guān)注微信

        <ul id="qxxfc"><fieldset id="qxxfc"><tr id="qxxfc"></tr></fieldset></ul>
          美女被 到爽 视频 | 成人视频在线免费播放 | 日日偷换短篇高h合集溪夕汐 | 老女人高潮了使劲呀 | 色情网一区二区三区四区无码视频 | 国产一a毛一a毛A免费看图 | 99爱爱 | 国产精品无码在线观看 | aaa女郎大尺度写真视频54 | 国产7页|