|
|
package com.yohoufo.user.service.impl;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Map.Entry;
|
...
|
...
|
@@ -75,7 +76,7 @@ public class InBoxServiceImpl implements IInBoxService { |
|
|
return result;
|
|
|
}
|
|
|
//缓存没有则从数据库查
|
|
|
Map<Integer,TypeCountInbox> typeCountMap = inBoxDao.selectTypeCount(getTableName(uid), uid, "N", "N");
|
|
|
Map<Integer,TypeCountInbox> typeCountMap = selectTypeCount(getTableName(uid), uid, "N", "N");
|
|
|
result = new JSONArray();
|
|
|
for(InboxTypeEnum typeEnum : InboxTypeEnum.values()) {
|
|
|
JSONObject obj = new JSONObject();
|
...
|
...
|
@@ -90,6 +91,18 @@ public class InBoxServiceImpl implements IInBoxService { |
|
|
return result;
|
|
|
}
|
|
|
|
|
|
private Map<Integer, TypeCountInbox> selectTypeCount(String tableName, int uid, String isRead, String isDel) {
|
|
|
Map<Integer, TypeCountInbox> result = new HashMap<>();
|
|
|
for(InboxTypeEnum typeEnum : InboxTypeEnum.values()) {
|
|
|
TypeCountInbox inbox = new TypeCountInbox();
|
|
|
int count = inBoxDao.selectTypeCount(tableName, uid, isRead, isDel, typeEnum.getId());
|
|
|
inbox.setCount(count);
|
|
|
inbox.setType(typeEnum.getId());
|
|
|
result.put(typeEnum.getId(), inbox);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
private void addNewUserGuideMessage(Integer uid) {
|
|
|
log.info("enter addNewUserGuideMessage. uid is {}",uid);
|
|
|
try{
|
...
|
...
|
|