动态多语言
This commit is contained in:
@@ -135,7 +135,11 @@ public enum I18nAlertEnum {
|
|||||||
COMMUNITY_SHARE("%s 分享了你的動態!"),
|
COMMUNITY_SHARE("%s 分享了你的動態!"),
|
||||||
COMMUNITY_COMMENT("%s 評論了你的動態"),
|
COMMUNITY_COMMENT("%s 評論了你的動態"),
|
||||||
COMMUNITY_COMMENT_REPLY("%s 回復了你的評論"),
|
COMMUNITY_COMMENT_REPLY("%s 回復了你的評論"),
|
||||||
COMMUNITY_COMMENT_REPLY_COMPLETE("%s 回復了 %s 的評論"),
|
|
||||||
|
COMMUNITY_COMMENT_REPLY_COMPLETE("{0} 回復了 {1} 的評論"),
|
||||||
|
COMMUNITY_LIKE_V1("贊了你的動態!"),
|
||||||
|
COMMUNITY_SHAREV1("分享了你的動態!"),
|
||||||
|
COMMUNITY_COMMENT_DELETE("该评论已被删除!"),
|
||||||
|
|
||||||
//社区论坛小秘书定制通知
|
//社区论坛小秘书定制通知
|
||||||
COMMUNITY_SECRET_APPROVE_TITLE("動態審核通知"),
|
COMMUNITY_SECRET_APPROVE_TITLE("動態審核通知"),
|
||||||
|
@@ -15,8 +15,10 @@ import com.accompany.community.service.IInteractiveMsgService;
|
|||||||
import com.accompany.community.vo.DynamicResVo;
|
import com.accompany.community.vo.DynamicResVo;
|
||||||
import com.accompany.community.vo.InteractiveMsgCount;
|
import com.accompany.community.vo.InteractiveMsgCount;
|
||||||
import com.accompany.community.vo.InteractiveMsgInfoVo;
|
import com.accompany.community.vo.InteractiveMsgInfoVo;
|
||||||
|
import com.accompany.core.enumeration.I18nAlertEnum;
|
||||||
import com.accompany.core.exception.ServiceException;
|
import com.accompany.core.exception.ServiceException;
|
||||||
import com.accompany.core.model.Users;
|
import com.accompany.core.model.Users;
|
||||||
|
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||||
import com.accompany.sharding.model.DynamicComment;
|
import com.accompany.sharding.model.DynamicComment;
|
||||||
import com.accompany.world.entity.World;
|
import com.accompany.world.entity.World;
|
||||||
import com.accompany.world.service.IWorldService;
|
import com.accompany.world.service.IWorldService;
|
||||||
@@ -214,6 +216,7 @@ public class InteractiveService extends CommunityBaseService {
|
|||||||
condition.setIsDelete(InteractiveDeleteEnum.UNDELETE.getValue());
|
condition.setIsDelete(InteractiveDeleteEnum.UNDELETE.getValue());
|
||||||
condition.addOrderByDesc("id");
|
condition.addOrderByDesc("id");
|
||||||
List<InteractiveMsg> msgList;
|
List<InteractiveMsg> msgList;
|
||||||
|
Users reqUser = usersService.getUsersByUid(req.getUid());
|
||||||
// id 不存在时,获取所有的未读记录,不限制返回数
|
// id 不存在时,获取所有的未读记录,不限制返回数
|
||||||
if(null == req.getId()) {
|
if(null == req.getId()) {
|
||||||
condition.setStatus(InteractiveStatusEnum.UNREAD.getValue());
|
condition.setStatus(InteractiveStatusEnum.UNREAD.getValue());
|
||||||
@@ -237,7 +240,7 @@ public class InteractiveService extends CommunityBaseService {
|
|||||||
// 未读记录的id
|
// 未读记录的id
|
||||||
List<Long> uidList = new LinkedList<>();
|
List<Long> uidList = new LinkedList<>();
|
||||||
for(InteractiveMsg interactiveMsg : msgList) {
|
for(InteractiveMsg interactiveMsg : msgList) {
|
||||||
list.add(convertInfoVo(interactiveMsg));
|
list.add(convertInfoVo(interactiveMsg, reqUser));
|
||||||
if(InteractiveStatusEnum.UNREAD.getValue().equals(interactiveMsg.getStatus())) {
|
if(InteractiveStatusEnum.UNREAD.getValue().equals(interactiveMsg.getStatus())) {
|
||||||
uidList.add(interactiveMsg.getId());
|
uidList.add(interactiveMsg.getId());
|
||||||
}
|
}
|
||||||
@@ -259,7 +262,7 @@ public class InteractiveService extends CommunityBaseService {
|
|||||||
* @param msg
|
* @param msg
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private InteractiveMsgInfoVo convertInfoVo(InteractiveMsg msg) {
|
private InteractiveMsgInfoVo convertInfoVo(InteractiveMsg msg, Users reqUser) {
|
||||||
InteractiveMsgInfoVo info = new InteractiveMsgInfoVo();
|
InteractiveMsgInfoVo info = new InteractiveMsgInfoVo();
|
||||||
// 动态
|
// 动态
|
||||||
Dynamic dynamic = getDynamic(msg.getDynamicId());
|
Dynamic dynamic = getDynamic(msg.getDynamicId());
|
||||||
@@ -305,13 +308,15 @@ public class InteractiveService extends CommunityBaseService {
|
|||||||
|| InteractiveActionTypeEnum.REPLY.getValue().equals((msg.getActionType()))) {
|
|| InteractiveActionTypeEnum.REPLY.getValue().equals((msg.getActionType()))) {
|
||||||
DynamicComment dynamicComment = iDynamicCommentService.getById(msg.getTargetId());
|
DynamicComment dynamicComment = iDynamicCommentService.getById(msg.getTargetId());
|
||||||
if(null != dynamicComment) {
|
if(null != dynamicComment) {
|
||||||
|
String message1 = I18NMessageSourceUtil.getMessage(I18nAlertEnum.COMMUNITY_COMMENT_DELETE, reqUser.getPartitionId());
|
||||||
message = CommentStatusEnum.DELETE.getValue().equals(dynamic.getStatus())
|
message = CommentStatusEnum.DELETE.getValue().equals(dynamic.getStatus())
|
||||||
? "该评论已被删除" : dynamicComment.getContent();
|
? message1
|
||||||
|
: dynamicComment.getContent();
|
||||||
}
|
}
|
||||||
} else if(InteractiveActionTypeEnum.LIKE.getValue().equals(msg.getActionType())) {
|
} else if(InteractiveActionTypeEnum.LIKE.getValue().equals(msg.getActionType())) {
|
||||||
message = "赞了你的动态";
|
message = I18NMessageSourceUtil.getMessage(I18nAlertEnum.COMMUNITY_LIKE_V1, reqUser.getPartitionId());
|
||||||
} else if(InteractiveActionTypeEnum.SHARE.getValue().equals(msg.getActionType())) {
|
} else if(InteractiveActionTypeEnum.SHARE.getValue().equals(msg.getActionType())) {
|
||||||
message = "分享了你的动态";
|
message = I18NMessageSourceUtil.getMessage(I18nAlertEnum.COMMUNITY_SHAREV1, reqUser.getPartitionId());
|
||||||
}
|
}
|
||||||
info.setMessage(message);
|
info.setMessage(message);
|
||||||
info.setActionType(msg.getActionType());
|
info.setActionType(msg.getActionType());
|
||||||
|
Reference in New Issue
Block a user