Commit c63ad297 by zhangxingmin

push

parent 5946471a
......@@ -49,7 +49,7 @@ public class MiniprogramMessageSender implements MessageSender {
String secret = wxConfig.getString("secret");
// 2. 查询模板配置(获取微信侧 templateId 和 content 模板)
NotificationTemplate template = templateService.getById(task.getTemplateBizId());
NotificationTemplate template = templateService.getByTemplateBizId(task.getTemplateBizId());
log.info("进入小程序消息发送器=>消息模板:{}", JSON.toJSONString(template));
if (template == null) {
return SendResult.failNonRetryable("TEMPLATE_NOT_EXIST", "模板不存在");
......
......@@ -13,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface INotificationTemplateService extends IService<NotificationTemplate> {
NotificationTemplate getByTemplateBizId(String templateBizId);
}
package com.yd.notice.service.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yd.notice.service.model.NotificationTemplate;
import com.yd.notice.service.dao.NotificationTemplateMapper;
import com.yd.notice.service.service.INotificationTemplateService;
......@@ -17,4 +18,11 @@ import org.springframework.stereotype.Service;
@Service
public class NotificationTemplateServiceImpl extends ServiceImpl<NotificationTemplateMapper, NotificationTemplate> implements INotificationTemplateService {
@Override
public NotificationTemplate getByTemplateBizId(String templateBizId) {
return this.getOne(new LambdaQueryWrapper<NotificationTemplate>()
.eq(NotificationTemplate::getTemplateBizId,templateBizId)
.last(" limit 1 ")
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment