mp:优化前端消息发送的缓存逻辑

This commit is contained in:
YunaiV
2023-01-12 20:25:00 +08:00
parent 7ba6a2e385
commit 858b4e81a5
4 changed files with 59 additions and 36 deletions

View File

@ -31,6 +31,9 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import javax.validation.Validator;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.MESSAGE_SEND_FAIL;
/**
* 粉丝消息表 Service 实现类
*
@ -115,7 +118,7 @@ public class MpMessageServiceImpl implements MpMessageService {
try {
mpService.getKefuService().sendKefuMessageWithResponse(wxMessage);
} catch (WxErrorException e) {
throw new RuntimeException(e);
throw exception(MESSAGE_SEND_FAIL, e.getError().getErrorMsg());
}
// 记录消息