2016-01-22 55 views
0

當我使用arrowdb儀表盤上傳照片上https://platform.appcelerator.comArrowDB中心上傳照片,以用戶

Cloud.Users.query只顯示photo_id

但whne我創建使用儀表盤上的新用戶,並附照片它顯示在Cloud.Users.query

例如。相片用戶之後上傳創建

{ 
"id": "563019f18cb04aede69e2111", 
"first_name": "store1", 
"last_name": "123", 
"created_at": "2015-10-28T00:42:25+0000", 
"updated_at": "2016-01-22T08:59:44+0000", 
"external_accounts": [], 
"confirmed_at": "2015-10-28T00:42:25+0000", 
"username": "user", 
"admin": "false", 
"stats": { 
    "photos": { 
     "total_count": 0 
    }, 
    "storage": { 
     "used": 0 
    } 
}, 
"photo_id": "56a1dc083a654d090d126792", 
"friend_counts": { 
    "requests": 0, 
    "friends": 0 
} 

}

例如。在創建用戶

{ 
"id": "56a1f0333a65234234390d7", 
"first_name": "qqqq", 
"last_name": "wwwe", 
"created_at": "2016-01-22T09:02:43+0000", 
"updated_at": "2016-01-22T09:07:18+0000", 
"external_accounts": [], 
"confirmed_at": "2016-01-22T09:02:43+0000", 
"username": "qwe", 
"admin": "false", 
"stats": { 
    "photos": { 
     "total_count": 0 
    }, 
    "storage": { 
     "used": 0 
    } 
}, 
"photo": { 
    "id": "56a1f0333a654d090d0390d8", 
    "filename": "userPhoto.jpg", 
    "size": 25394, 
    "md5": "e20f4fcadf6cde9fccfb458dd11951d4", 
    "created_at": "2016-01-22T09:02:43+0000", 
    "updated_at": "2016-01-22T09:02:43+0000", 
    "processed": true, 
    "urls": { 
     "original": "https://s3-us-west-1.amazonaws.com/storage-platform.cloud.appcelerator.com/xmqh1djNEIChtQFP6d37HNH5DQNCXQoX/photos/51/d4/56a1f0333a654d090d0390d9/userPhoto_original.jpg" 
    }, 
    "content_type": "image/jpeg", 
    "user": { 
     "id": "56a1f0333a65234234390d7", 
     "first_name": "qqqq", 
     "last_name": "wwwe", 
     "created_at": "2016-01-22T09:02:43+0000", 
     "updated_at": "2016-01-22T09:07:18+0000", 
     "external_accounts": [], 
     "confirmed_at": "2016-01-22T09:02:43+0000", 
     "username": "qwe", 
     "admin": "false", 
     "stats": { 
      "photos": { 
       "total_count": 0 
      }, 
      "storage": { 
       "used": 0 
      } 
     }, 
     "photo_id": "56a1f0333a654d090d0390d8", 
     "friend_counts": { 
      "requests": 0, 
      "friends": 0 
     } 
    } 
}, 
"friend_counts": { 
    "requests": 0, 
    "friends": 0 
} 
} 

照片上傳基本上是一個有照片創作期間上傳用戶顯示這個額外的信息

"photo": { 
    "id": "56a1f0333a654d090d0390d8", 
    "filename": "userPhoto.jpg", 
    "size": 25394, 
    "md5": "e20f4fcadf6cde9fccfb458dd11951d4", 
    "created_at": "2016-01-22T09:02:43+0000", 
    "updated_at": "2016-01-22T09:02:43+0000", 
    "processed": true, 
    "urls": { 
     "original": "https://s3-us-west-1.amazonaws.com/storage-platform.cloud.appcelerator.com/xmqh1djNEIChtQFP6d37HNH5DQNCXQoX/photos/51/d4/56a1f0333a654d090d0390d9/userPhoto_original.jpg" 
    }, 
    "content_type": "image/jpeg", 
    "user": { 
     "id": "56a1f0333a65234234390d7", 
     "first_name": "qqqq", 
     "last_name": "wwwe", 
     "created_at": "2016-01-22T09:02:43+0000", 
     "updated_at": "2016-01-22T09:07:18+0000", 
     "external_accounts": [], 
     "confirmed_at": "2016-01-22T09:02:43+0000", 
     "username": "qwe", 
     "admin": "false", 
     "stats": { 
      "photos": { 
       "total_count": 0 
      }, 
      "storage": { 
       "used": 0 
      } 
     }, 
+0

看起來你已經發現了一個錯誤。請檢查這是否是[Appcelerator JIRA](https://jira.appcelerator.org)上的已知問題。如果不是,則創建一張票據,鏈接到此問題,但也會在票證中提供可重複的代碼,步驟和環境信息。不要忘記在這裏放下一張票的鏈接,以便其他人可以和你一起觀看。 –

回答

1

我一直也遇到這樣的問題,再加上我已經注意到,圖像不會從ArrowDB用戶界面顯示(不確定是否相關)。 photo: {}

我已經創造了ArrowDB用戶界面https://jira.appcelerator.org/browse/API-1277票:當你查詢模型 的API只返回一個空的對象。

sachinmw您是否爲最初的問題創建了票?

解決方法是使用photo_id並運行另一個單獨的查詢來檢索照片模型,但這不利於網絡優化。


編輯與Appcelerator的處理直接左右有一個空photo: {}對象返回答案後

好很簡單:

每當你在任何ArrowDB使用query()功能類似Cloud.Objects.query()ti.cloud對象,默認情況下會有一個名爲response_json_depth的參數,該參數默認設置爲1,並且只會返回由該對象返回的JSON對象的一個​​級別API。

,而不會影響參數,我看到:

{ 
    "Vehicle": [ 
     { 
      "name": "foo", 
      "photo: {} 
     } 
    ] 
} 

通過設置response_json_depth3我設法有:

{ 
    "Vehicle": [ 
     { 
      "name": "foo", 
      "photo: { 
       "urls": { 
        "original": "http://bar.com" 
       } 
      } 
     } 
    ] 
} 

希望這將幫助別人。這也適用於任何ArrowDB對象的Cloud.Objects.show()方法。