/** * 查询搜索历史 * * @return */ @Override public ResponseResult findUserSearch() { //获取当前用户 ApUser user = AppThreadLocalUtil.getUser(); if(user == null){ return ResponseResult.errorResult(AppHttpCodeEnum.NEED_LOGIN); } //根据用户查询数据,根据时间倒叙 List<ApUserSearch> apUserSearches = mongoTemplate.find(Query.query(Criteria.where("userId").is(user.getId())).with(Sort.by(Sort.Direction.DESC, "createdTime")), ApUserSearch.class); return ResponseResult.okResult(apUserSearches); }
标签:Sort,历史,return,ResponseResult,查询,搜索,user,apUserSearches From: https://www.cnblogs.com/fxzm/p/17538433.html