!19 1.更新微信群二维码2.可能存在的NPE 3.优化redis中验证码过期的NPE 4.增强回复类型
Merge pull request !19 from Dawn/dev
This commit is contained in:
@@ -25,6 +25,9 @@ public class EmojisMsgDTO implements Serializable {
|
||||
@Schema(description ="下载地址")
|
||||
@NotBlank
|
||||
private String url;
|
||||
|
||||
@Schema(description ="回复的消息id")
|
||||
private Long replyMsgId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,4 +28,6 @@ public class FileMsgDTO extends BaseFileDTO implements Serializable {
|
||||
@NotBlank
|
||||
private String fileName;
|
||||
|
||||
@Schema(description ="回复的消息id")
|
||||
private Long replyMsgId;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ public class ImgMsgDTO extends BaseFileDTO implements Serializable {
|
||||
@NotNull
|
||||
private Integer height;
|
||||
|
||||
@Schema(description ="回复的消息id")
|
||||
private Long replyMsgId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,4 +28,7 @@ public class SoundMsgDTO extends BaseFileDTO implements Serializable {
|
||||
@Schema(description ="时长(秒)")
|
||||
@NotNull
|
||||
private Integer second;
|
||||
|
||||
@Schema(description ="回复的消息id")
|
||||
private Long replyMsgId;
|
||||
}
|
||||
|
||||
@@ -41,4 +41,6 @@ public class VideoMsgDTO extends BaseFileDTO implements Serializable {
|
||||
@NotBlank
|
||||
private String thumbUrl;
|
||||
|
||||
@Schema(description ="回复的消息id")
|
||||
private Long replyMsgId;
|
||||
}
|
||||
|
||||
@@ -634,7 +634,8 @@ public class RoomAppServiceImpl implements RoomAppService {
|
||||
AbstractMsgHandler strategyNoNull = MsgHandlerFactory.getStrategyNoNull(message.getType());
|
||||
// 判断是群聊还是单聊
|
||||
if (Objects.equals(roomBaseInfo.getType(), RoomTypeEnum.GROUP.getType())) {
|
||||
resp.setText((StrUtil.isNotEmpty(resp.getMyName())? resp.getMyName(): lastMsgUidMap.get(message.getFromUid()).getName()) + ":" + strategyNoNull.showContactMsg(message));
|
||||
GroupMember messageUser = groupMemberCache.getMemberDetail(roomBaseInfo.getRoomId(), message.getFromUid());
|
||||
resp.setText(ObjectUtil.isNotNull(messageUser) && StrUtil.isNotEmpty(messageUser.getMyName())? messageUser.getMyName(): (lastMsgUidMap.get(message.getFromUid()).getName()) + ":" + strategyNoNull.showContactMsg(message));
|
||||
} else {
|
||||
resp.setText(strategyNoNull.showContactMsg(message));
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public class EmojisMsgHandler extends AbstractMsgHandler<EmojisMsgDTO> {
|
||||
Message update = new Message();
|
||||
update.setId(msg.getId());
|
||||
update.setExtra(extra);
|
||||
update.setReplyMsgId(body.getReplyMsgId());
|
||||
extra.setEmojisMsgDTO(body);
|
||||
messageDao.updateById(update);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public class FileMsgHandler extends AbstractMsgHandler<FileMsgDTO> {
|
||||
Message update = new Message();
|
||||
update.setId(msg.getId());
|
||||
update.setExtra(extra);
|
||||
update.setReplyMsgId(body.getReplyMsgId());
|
||||
extra.setFileMsg(body);
|
||||
messageDao.updateById(update);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public class ImgMsgHandler extends AbstractMsgHandler<ImgMsgDTO> {
|
||||
Message update = new Message();
|
||||
update.setId(msg.getId());
|
||||
update.setExtra(extra);
|
||||
update.setReplyMsgId(body.getReplyMsgId());
|
||||
extra.setImgMsgDTO(body);
|
||||
messageDao.updateById(update);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ public class SoundMsgHandler extends AbstractMsgHandler<SoundMsgDTO> {
|
||||
Message update = new Message();
|
||||
update.setId(msg.getId());
|
||||
update.setExtra(extra);
|
||||
update.setReplyMsgId(body.getReplyMsgId());
|
||||
extra.setSoundMsgDTO(body);
|
||||
messageDao.updateById(update);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,6 @@ public class TextMsgHandler extends AbstractMsgHandler<TextMsgReq> {
|
||||
Integer gapCount = messageDao.getGapCount(msg.getRoomId(), body.getReplyMsgId(), msg.getId());
|
||||
update.setGapCount(gapCount);
|
||||
update.setReplyMsgId(body.getReplyMsgId());
|
||||
|
||||
}
|
||||
//判断消息url跳转
|
||||
Map<String, UrlInfo> urlContentMap = URL_TITLE_DISCOVER.getUrlContentMap(body.getContent());
|
||||
|
||||
@@ -30,6 +30,7 @@ public class VideoMsgHandler extends AbstractMsgHandler<VideoMsgDTO> {
|
||||
Message update = new Message();
|
||||
update.setId(msg.getId());
|
||||
update.setExtra(extra);
|
||||
update.setReplyMsgId(body.getReplyMsgId());
|
||||
extra.setVideoMsgDTO(body);
|
||||
messageDao.updateById(update);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class EmailServiceImpl implements EmailService {
|
||||
}
|
||||
|
||||
try{
|
||||
int expireTime = 300;
|
||||
int expireTime = 1800;
|
||||
// 3. 发送邮箱验证码到用户邮箱
|
||||
String systemName = configService.get("systemName");
|
||||
String time = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.hula.core.user.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.auth0.jwt.interfaces.Claim;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -77,7 +78,14 @@ public class LoginServiceImpl implements LoginService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void normalRegister(RegisterReq req) {
|
||||
String emailCode = RedisUtils.hget("emailCode", req.getUuid()).toString();
|
||||
String emailCode;
|
||||
Object codeObj = RedisUtils.hget("emailCode", req.getUuid());
|
||||
if (ObjectUtil.isNotNull(codeObj)) {
|
||||
emailCode = codeObj.toString();
|
||||
} else {
|
||||
throw new BizException("验证码已过期");
|
||||
}
|
||||
|
||||
if(StrUtil.isEmpty(emailCode) || !emailCode.equals(req.getCode())){
|
||||
throw new BizException("验证码错误!");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.hula.core.user.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.hula.common.event.UserBlackEvent;
|
||||
@@ -186,7 +187,14 @@ public class UserServiceImpl implements UserService {
|
||||
@Override
|
||||
public Boolean bindEmail(Long uid, BindEmailReq req) {
|
||||
// 1.校验验证码
|
||||
String emailCode = RedisUtils.hget("emailCode", req.getUuid()).toString();
|
||||
String emailCode;
|
||||
Object codeObj = RedisUtils.hget("emailCode", req.getUuid());
|
||||
if (ObjectUtil.isNotNull(codeObj)) {
|
||||
emailCode = codeObj.toString();
|
||||
} else {
|
||||
throw new BizException("验证码已过期");
|
||||
}
|
||||
|
||||
if(StrUtil.isEmpty(emailCode) || !emailCode.equals(req.getCode())){
|
||||
throw new BizException("验证码错误!");
|
||||
}
|
||||
|
||||
BIN
preview/wx.png
BIN
preview/wx.png
Binary file not shown.
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 166 KiB |
Reference in New Issue
Block a user