端点类方法:
@ApiMethod(name = "listRecords")
public List<ReplyRecord> listRecords(@Named("count") int count) {
List<ReplyRecord> records = ofy().load().type(ReplyRecord.class).limit(count).list();
return records;
}
在AsyncTask doInBackground中调用activity方法
regService.record(sf.getString("regId","0"),obj.getqId(),obj.getAnsId()).execute();
Registration.ListRecords rr= regService.listRecords(20);
这不是对api方法的直接调用,因此我得到了一些 Registration.ListRecords 类型对象。我真的很困惑,请建议我直接输入列表类型的方法
答案 0 :(得分:1)
你快到了。模型中的ListRecords
对象基本上是一个请求,因此您还必须执行它并在完成后调用.getItems()
以获得结果List
:
List<ReplyRecord> results = rr.execute().getItems();