perf:调整消息通知

This commit is contained in:
曾文豪
2023-03-31 14:21:07 +08:00
parent 1c0e63bf98
commit 8d9632bcaa
8 changed files with 145 additions and 70 deletions

View File

@@ -1,23 +0,0 @@
package com.tiesheng.message.service;
import cn.hutool.json.JSONUtil;
import cn.hutool.log.LogFactory;
import com.tiesheng.message.pojos.MessageReqResp;
/**
* @author hao
*/
public interface TieshengMessageConfigurer {
/**
* 消息发送后
*
* @param reqResp
*/
default void onMessageSend(String type, MessageReqResp reqResp) {
LogFactory.get().info(JSONUtil.toJsonStr(reqResp));
}
}

View File

@@ -0,0 +1,32 @@
package com.tiesheng.message.service;
import com.tiesheng.message.pojos.MessageReqResp;
/**
* @author hao
*/
public interface TieshengMessageSender {
/**
* 发送消息
*
* @param user
* @param title
* @param content
* @param body
* @param channel 消息通道,如果为空表示所有通道
* @return 返回的内容,如果为空表示发送成功
*/
MessageReqResp send(String user, String title, Object body);
/**
* 获取通道
*
* @return
*/
String getChannel();
}

View File

@@ -1,11 +0,0 @@
package com.tiesheng.message.service.impl;
import com.tiesheng.message.service.TieshengMessageConfigurer;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Configuration;
@Configuration
@ConditionalOnMissingBean(value = TieshengMessageConfigurer.class, ignored = DefaultMessageConfigurer.class)
public class DefaultMessageConfigurer implements TieshengMessageConfigurer {
}