ngqa中的写法是
@Inject("java:$commons.dao()")
private MongoDao dao;
/**核心查询方法,通用查询*/
public Pager<Student> query(QuestionQuery query) {
if (query == null)
query = new QuestionQuery();
MCur cur = MCur.DESC("updatedAt");
Pager<Student> pager = new Pager<Student>();
pager.setCount(dao.count(Student.class, query.q));
pager.setPage(query.page);
pager.setPageSize(query.pageSize);
if (query.skip() > 0)
cur.skip(query.skip());
if (query.limit() > 0)
cur.limit(query.limit());
pager.setData(dao.find(Student.class, query.q, cur));
return pager;
}
现在最新版中这个怎么写呢 ?