fix enable/disable notice

main
wangqing 8 months ago
parent 4f89b4d8df
commit 7aa04bdddb

@ -140,9 +140,9 @@ public class UserInfo implements Serializable {
/** /**
* *
*/ */
private int enableNotice; private Integer enableNotice;
/** /**
* *
*/ */
private int enablePush; private Integer enablePush;
} }

@ -107,7 +107,7 @@ public class CommentService {
commentHis.setJournalImage(parentComment.getJournalImage()); commentHis.setJournalImage(parentComment.getJournalImage());
commentHis.setCreateTime(new Date()); commentHis.setCreateTime(new Date());
UserInfo parentCommentUser =userInfoService.findById(parentComment.getUserId()); UserInfo parentCommentUser =userInfoService.findById(parentComment.getUserId());
if (0 != parentCommentUser.getEnableNotice()) { if (null ==parentCommentUser.getEnableNotice() || 1 == parentCommentUser.getEnableNotice()) {
commentHisDao.save(commentHis); commentHisDao.save(commentHis);
} }
@ -139,7 +139,7 @@ public class CommentService {
userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX+userLoginDto.getAvatar()); userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX+userLoginDto.getAvatar());
userMessageDto.setSendUserId(userLoginDto.getUserId()); userMessageDto.setSendUserId(userLoginDto.getUserId());
userMessageDto.setSendUserNickName(userLoginDto.getNickName()); userMessageDto.setSendUserNickName(userLoginDto.getNickName());
if (0 != parentCommentUser.getEnableNotice()) { if (null ==parentCommentUser.getEnableNotice() || 1 == parentCommentUser.getEnableNotice()) {
rabbitTemplate.convertAndSend("userMessage",userMessageDto); rabbitTemplate.convertAndSend("userMessage",userMessageDto);
} }
@ -241,7 +241,7 @@ public class CommentService {
Comment parentComment = commentDao.findById(commentId).get(); Comment parentComment = commentDao.findById(commentId).get();
UserInfo parentCommentUser =userInfoService.findById(parentComment.getUserId()); UserInfo parentCommentUser =userInfoService.findById(parentComment.getUserId());
if (0 != parentCommentUser.getEnableNotice()) { if (null ==parentCommentUser.getEnableNotice() || 1 == parentCommentUser.getEnableNotice()) {
/** /**
* *
*/ */

@ -123,11 +123,11 @@ public class MyController extends BaseController {
userRespDTO.setAppleEmail(user.getAppleEmail()); userRespDTO.setAppleEmail(user.getAppleEmail());
userRespDTO.setEnableNotice(1); userRespDTO.setEnableNotice(1);
userRespDTO.setEnablePush(1); userRespDTO.setEnablePush(1);
if (0 ==user.getEnableNotice()) { if (null != user.getEnableNotice()) {
userRespDTO.setEnableNotice(0); userRespDTO.setEnableNotice(user.getEnableNotice());
} }
if (0 == user.getEnablePush()) { if (null != user.getEnablePush()) {
userRespDTO.setEnablePush(0); userRespDTO.setEnablePush(user.getEnablePush());
} }
return Result.success(userRespDTO); return Result.success(userRespDTO);
} }

@ -64,10 +64,10 @@ public class UserRespDTO implements Serializable {
* *
*/ */
@ApiModelProperty(value = "是否启用通知0为关闭1为启用默认启用") @ApiModelProperty(value = "是否启用通知0为关闭1为启用默认启用")
private int enableNotice; private Integer enableNotice;
/** /**
* *
*/ */
@ApiModelProperty(value = "是否启用推送0为关闭1为启用默认启用") @ApiModelProperty(value = "是否启用推送0为关闭1为启用默认启用")
private int enablePush; private Integer enablePush;
} }

@ -164,9 +164,9 @@ public class UserInfo implements Serializable {
/** /**
* *
*/ */
private int enableNotice; private Integer enableNotice;
/** /**
* *
*/ */
private int enablePush; private Integer enablePush;
} }

@ -279,7 +279,7 @@ public class UserCollectInfoService {
// 向他人发送 新粉丝 消息 // 向他人发送 新粉丝 消息
UserInfo followUserInfo =userInfoDao.findById(objectId).get(); UserInfo followUserInfo =userInfoDao.findById(objectId).get();
if (0 != followUserInfo.getEnableNotice()) { if (null == followUserInfo.getEnableNotice() || 1== followUserInfo.getEnableNotice() ) {
sendMessageToFollows(user, objectId); sendMessageToFollows(user, objectId);
} }

Loading…
Cancel
Save