|
|
hace 3 años | |
|---|---|---|
| commom | hace 3 años | |
| im-platform | hace 3 años | |
| im-server | hace 3 años | |
| im-ui | hace 3 años | |
| minio | hace 3 años | |
| 截图 | hace 3 años | |
| 打包 | hace 3 años | |
| .gitignore | hace 3 años | |
| LICENSE | hace 3 años | |
| README.md | hace 3 años | |
| pom.xml | hace 3 años |
体验地址:https://8.134.92.70
账号: 张三/123456 李四/123456 也可以自行注册账号
体验后记得帮忙点个star哟!
| 模块 | 功能 |
|---|---|
| im-platform | 与页面进行交互,处理业务请求 |
| im-server | 推送聊天消息 |
| im-common | 公共包 |
1.安装运行环境
2.启动后端服务
mvn clean package
java -jar ./im-platform/target/im-platform.jar
java -jar ./im-server/target/im-server.jar
3.启动前端ui
cd im-ui
npm install
npm run serve
4.访问localhost:8080
消息推送的代码目前已经完成了封装,可以通过下面的教程快速的引入到自己的项目中
4.1服务器接入 引入pom文件
<dependency>
<groupId>com.bx</groupId>
<artifactId>im-client</artifactId>
<version>1.1.0</version>
</dependency>
依赖了redis,所以要配置redis地址:
spring:
redis:
host: 127.0.0.1
port: 6379
database: 1
直接把IMClient @Autowire进来就可以发送消息了:
@Autowired
private IMClient imClient;
public void sendMessage(){
PrivateMessageInfo messageInfo = new PrivateMessageInfo();
Long recvId = 1L;
messageInfo.setId(123L);
messageInfo.setContent("你好呀");
messageInfo.setType(MessageType.TEXT.getCode());
messageInfo.setSendId(userId);
messageInfo.setRecvId(recvId);
messageInfo.setSendTime(new Date());
imClient.sendPrivateMessage(recvId,messageInfo);
}
QQ: 825657193 邮箱:825657193@qq.com
有任何问题,欢迎给我留言哦
撸码不易,喜欢的朋友麻烦点个star吧!