簡體   English   中英

Google Cloud Endpoints Multi Get

[英]Google Cloud Endpoints Multi Get

我有一個來自Endpoints Proto Datastore API的EndpointsModel,稱為Resource,我正在使用以下資源請求10個項目:Resource.query()。fetch(10)。

問題是它正在返回一組資源,但是根據“創建端點API”的文檔,我需要返回一組消息。

https://cloud.google.com/appengine/docs/python/endpoints/create_api

帶有Google Cloud Enpoints的原始RPC消息

有沒有將我的模型數組轉換為消息的標准方法,還是for循環是實現此目的的最有效方法?

提前致謝!

我做了一些進一步的挖掘,並在GitHub( https://github.com/GoogleCloudPlatform/appengine-endpoints-tictactoe-python )上找到了Google Cloud Platform的示例。 tictactoe_api.py在返回的NDB值上使用for循環,並在models.py中使用自定義to_message()函數將其轉換為protoRPC消息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM