查询搜索历史
/** * 查询搜索历史 * * @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); }