Commit 9cc6a8e9 authored by jiaorz's avatar jiaorz

修改提前还车逻辑

parent 58258299
...@@ -124,7 +124,7 @@ public class MsgBiz { ...@@ -124,7 +124,7 @@ public class MsgBiz {
} }
public ObjectRestResponse getMsgListByUserId(Integer page, Integer limit) { public ObjectRestResponse getMsgListByUserId(Integer page, Integer limit, Integer type) {
//获取所有朋友圈 //获取所有朋友圈
page = page == null ? 1 : page; page = page == null ? 1 : page;
limit = limit == null ? 10 : limit; limit = limit == null ? 10 : limit;
...@@ -137,8 +137,9 @@ public class MsgBiz { ...@@ -137,8 +137,9 @@ public class MsgBiz {
} }
Pageable pageable = PageRequest.of(--page, limit); Pageable pageable = PageRequest.of(--page, limit);
List<Integer> ids = new ArrayList<>(); List<Integer> ids = new ArrayList<>();
ids.add(2); if(type != null) {
ids.add(4); ids.add(type);
}
Query query = new Query(Criteria.where("body.type").in(ids)); Query query = new Query(Criteria.where("body.type").in(ids));
query.addCriteria(Criteria.where("userId").is(userId)); query.addCriteria(Criteria.where("userId").is(userId));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size(); int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
......
...@@ -32,7 +32,7 @@ public class MsgController { ...@@ -32,7 +32,7 @@ public class MsgController {
} }
@GetMapping(value = "/getByUserId") @GetMapping(value = "/getByUserId")
public ObjectRestResponse getByUserId(Integer page, Integer limit) { public ObjectRestResponse getByUserId(Integer page, Integer limit, Integer type) {
return msgBiz.getMsgListByUserId(page, limit); return msgBiz.getMsgListByUserId(page, limit, type);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment