| | |
| | | */
|
| | | @RequestMapping(value = "getUnReadMsgCount", method = RequestMethod.POST)
|
| | | public void getUnReadMsgCount(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | int deviceCount = msgDeviceReadStateService.getUnReadCount(acceptData.getDevice(),
|
| | | "android".equalsIgnoreCase(acceptData.getPlatform()) ? 1 : 2);
|
| | | GsonBuilder androidBuilder = new GsonBuilder().registerTypeAdapter(Integer.class,
|
| | | new JsonSerializer<Integer>() {
|
| | | @Override
|
| | |
| | | } else {
|
| | | data = JSONObject.fromObject(JsonUtil.getApiCommonGson().toJson(num));
|
| | | }
|
| | | data.put("totalCount", deviceCount);
|
| | | data.put("totalCount", 0);
|
| | |
|
| | | try {
|
| | | UserSettingsVO vo = userCustomSettingsService.getMySettings(uid);
|
| | |
| | | UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid);
|
| | |
|
| | | int totalCount = num.getTypeAccount() + num.getTypeInvite() + num.getTypeMoney() + num.getTypeOrder()
|
| | | + num.getTypeScore() + num.getTypeSystem() + num.getTypeOther() + deviceCount;
|
| | | + num.getTypeScore() + num.getTypeSystem() + num.getTypeOther();
|
| | |
|
| | | JSONObject data = null;
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | |
| | | List<PushGoods> list = pushGoodsService.listHistoryByPushTime(0, 1, uid, createTime);
|
| | | if (list != null && list.size() > 0) {
|
| | | MsgDeviceReadState state = msgDeviceReadStateService.getByDeviceAndPlatformAndType(
|
| | | UserCommonMsgVO.TYPE_ZHUSHOU, acceptData.getDevice(),
|
| | | UserCommonMsgVO.TYPE_RECOMMEND, acceptData.getDevice(),
|
| | | acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2);
|
| | | boolean read = false;
|
| | | if (state != null && state.getReadTime() != null
|
| | |
| | |
|
| | | @RequestMapping(value = "setAllMsgRead", method = RequestMethod.POST)
|
| | | public void setAllMsgRead(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | msgDeviceReadStateService.setAllMsgRead(acceptData.getDevice(),
|
| | | "android".equalsIgnoreCase(acceptData.getPlatform()) ? 1 : 2);
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | |
| | | msgDeviceReadStateService.setDeviceMsgRead(UserCommonMsgVO.TYPE_RECOMMEND, acceptData.getDevice(),
|
| | | (acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2));
|
| | | } else if (type.equalsIgnoreCase(UserCommonMsgVO.TYPE_ZHUSHOU)) {
|
| | | msgDeviceReadStateService.setDeviceMsgRead(UserCommonMsgVO.TYPE_RECOMMEND, acceptData.getDevice(),
|
| | | msgDeviceReadStateService.setDeviceMsgRead(UserCommonMsgVO.TYPE_ZHUSHOU, acceptData.getDevice(),
|
| | | (acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2));
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|