|
@@ -3,23 +3,21 @@ package com.etotem.cfc.service.notification;
|
|
|
import com.etotem.cfc.dto.NotificationMessage;
|
|
import com.etotem.cfc.dto.NotificationMessage;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 微信通知通道(外部接口,预留)
|
|
|
|
|
|
|
+ * 微信通知通道(本期不支持)
|
|
|
* <p>
|
|
* <p>
|
|
|
- * 未接入微信订阅消息/模板消息前不发送,仅记录日志;接入后实现 send()。
|
|
|
|
|
- * 启用开关: notification.channels.wechat.enabled(默认 false)
|
|
|
|
|
|
|
+ * 待接入微信小程序订阅消息(需模板ID、用户订阅授权、openid)后启用。
|
|
|
|
|
+ * 当前 isEnabled() 固定返回 false,send() 仅记 debug 日志。
|
|
|
|
|
+ * 注意:本通道与 {@link WebhookNotificationChannel} 是不同实现,后者复用
|
|
|
|
|
+ * WechatWaitMsgService 推送待办消息,已投产并共享 wechat 通道类型。
|
|
|
*/
|
|
*/
|
|
|
@Component
|
|
@Component
|
|
|
public class WechatNotificationChannel implements NotificationChannel {
|
|
public class WechatNotificationChannel implements NotificationChannel {
|
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(WechatNotificationChannel.class);
|
|
private static final Logger log = LoggerFactory.getLogger(WechatNotificationChannel.class);
|
|
|
|
|
|
|
|
- @Value("${notification.channels.wechat.enabled:false}")
|
|
|
|
|
- private boolean enabled;
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String getChannelType() {
|
|
public String getChannelType() {
|
|
|
return "wechat";
|
|
return "wechat";
|
|
@@ -27,12 +25,12 @@ public class WechatNotificationChannel implements NotificationChannel {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public boolean isEnabled() {
|
|
public boolean isEnabled() {
|
|
|
- return enabled;
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void send(NotificationMessage message) {
|
|
public void send(NotificationMessage message) {
|
|
|
- // TODO: 接入微信订阅消息/模板消息后在此实现
|
|
|
|
|
- log.warn("[微信通道预留] 未接入微信消息服务,跳过发送: userId={}, title={}", message.getUserId(), message.getTitle());
|
|
|
|
|
|
|
+ // 本期不支持,待接入微信小程序订阅消息网关后启用
|
|
|
|
|
+ log.debug("[微信通道] 本期不支持,跳过发送: userId={}, title={}", message.getUserId(), message.getTitle());
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
+}
|