Commit 7833928c authored by jiaorz's avatar jiaorz

添加积分消息队列接口

parent 0e007d09
......@@ -45,7 +45,10 @@ public class MsgBiz {
public ObjectRestResponse getMsgList(Integer page, Integer limit, Integer type) throws Exception {
//获取所有朋友圈
AppUserDTO appUserDTO = userBiz.getUserInfo();
Integer userId = null;
if(appUserDTO != null) {
userId = appUserDTO.getImUserid();
}
log.info("获取消息列表: page = {}, limit = {}, type = {}", page, limit, type);
page = page == null ? 1 : page;
limit = limit == null ? 10 : limit;
......@@ -54,7 +57,7 @@ public class MsgBiz {
List<Msg> msgList = null;
if (type != null) {
query = new Query(Criteria.where("body.type").is(type));
msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), appUserDTO.getImUserid());
msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
return ObjectRestResponse.succ(goodPageInfo);
} else {
......@@ -62,7 +65,7 @@ public class MsgBiz {
ids.add(2);
ids.add(4);
query = new Query(Criteria.where("body.type").in(ids));
msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), appUserDTO.getImUserid());
msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
return ObjectRestResponse.succ(goodPageInfo);
}
......@@ -87,11 +90,15 @@ public class MsgBiz {
public ObjectRestResponse get(String id){
//获取所有朋友圈
AppUserDTO appUserDTO = userBiz.getUserInfo();
Integer userId = null;
if(appUserDTO != null) {
userId = appUserDTO.getImUserid();
}
if(id == null) {
return ObjectRestResponse.paramIsEmpty();
}
Query query = new Query(Criteria.where("id").is(new ObjectId(id)));
List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), appUserDTO.getImUserid());
List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
List<MsgVo> msgVoList = replaceMsgResult(msgList);
if(msgVoList.size() > 0) {
return ObjectRestResponse.succ(msgVoList.get(0));
......
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