Merge remote-tracking branch 'origin/dev/dev' into dev/dev
This commit is contained in:
@@ -59,7 +59,8 @@ public class CommonConstant {
|
|||||||
|
|
||||||
public static final List<String> IS_SUBSCRIBE = Arrays.asList("yes", "no");
|
public static final List<String> IS_SUBSCRIBE = Arrays.asList("yes", "no");
|
||||||
|
|
||||||
public static final String DEFAULT_AVATAR = "aida-users/87/avatar/default.jpg";
|
// public static final String DEFAULT_AVATAR = "aida-users/87/avatar/default.jpg";
|
||||||
|
public static final String DEFAULT_AVATAR = "aida-users/87/avatar/default.png";
|
||||||
|
|
||||||
/* 截止至2024/08/26,在Code-Create DB中pmr_users表中最大的用户id */
|
/* 截止至2024/08/26,在Code-Create DB中pmr_users表中最大的用户id */
|
||||||
public static final Long MAXIMUM_USER_ID = 704L;
|
public static final Long MAXIMUM_USER_ID = 704L;
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ public interface MessageCenterService extends IService<Notification> {
|
|||||||
|
|
||||||
void prePushMessage(Notification notification);
|
void prePushMessage(Notification notification);
|
||||||
|
|
||||||
|
void pushMessage(String type, Long receiverId);
|
||||||
|
|
||||||
void cancelPushMessage(String type, Long senderId, Long receiverId, Long portfolioId, Long commentId);
|
void cancelPushMessage(String type, Long senderId, Long receiverId, Long portfolioId, Long commentId);
|
||||||
|
|
||||||
Boolean setReadStatus(List<Long> notificationIdList, String type);
|
Boolean setReadStatus(List<Long> notificationIdList, String type);
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ public class MessageCenterServiceImpl extends ServiceImpl<NotificationMapper, No
|
|||||||
ArrayList<Map<String, Object>> resp = new ArrayList<>();
|
ArrayList<Map<String, Object>> resp = new ArrayList<>();
|
||||||
HashMap<String, Object> data = new HashMap<>();
|
HashMap<String, Object> data = new HashMap<>();
|
||||||
Long count;
|
Long count;
|
||||||
|
Long accountId = UserContext.getUserHolder().getId();
|
||||||
if (!type.equals("system")) {
|
if (!type.equals("system")) {
|
||||||
// 个人未读消息
|
// 个人未读消息
|
||||||
count = getUnreadCountByType(type, receiverId);
|
count = getUnreadCountByType(type, receiverId);
|
||||||
@@ -175,9 +176,19 @@ public class MessageCenterServiceImpl extends ServiceImpl<NotificationMapper, No
|
|||||||
// 系统未读消息
|
// 系统未读消息
|
||||||
count = getUnreadSystemNotification();
|
count = getUnreadSystemNotification();
|
||||||
}
|
}
|
||||||
|
if (type.equals("follow")){
|
||||||
|
HashMap<String, Object> followee = new HashMap<>();
|
||||||
|
HashMap<String, Object> follower = new HashMap<>();
|
||||||
|
follower.put("followerCount",portfolioService.getFollowerCount(accountId));
|
||||||
|
followee.put("followeeCount",portfolioService.getFolloweeCount(accountId));
|
||||||
|
resp.add(followee);
|
||||||
|
resp.add(follower);
|
||||||
|
}
|
||||||
|
|
||||||
data.put(type, count);
|
data.put(type, count);
|
||||||
resp.add(data);
|
if (count != 0){
|
||||||
|
resp.add(data);
|
||||||
|
}
|
||||||
String jsonString = JSON.toJSONString(resp);
|
String jsonString = JSON.toJSONString(resp);
|
||||||
log.info("消息推送 : {}", jsonString);
|
log.info("消息推送 : {}", jsonString);
|
||||||
|
|
||||||
|
|||||||
@@ -1115,6 +1115,8 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
} else {
|
} else {
|
||||||
throw new BusinessException("you.have.not.followed.the.current.user", 1);
|
throw new BusinessException("you.have.not.followed.the.current.user", 1);
|
||||||
}
|
}
|
||||||
|
// 3、更新关注人数
|
||||||
|
messageCenterService.pushMessage("follow", accountId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getFolloweeCount(Long accountId) {
|
public Long getFolloweeCount(Long accountId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user