Skip to content

Commit

Permalink
WeLine Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Acceloratn9 committed Apr 12, 2023
1 parent d8638c4 commit 848a9a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 设计文档
# WeLine (demo)

# 一、需求分析

Expand Down Expand Up @@ -35,17 +35,15 @@

## 3. 服务器:只创建一个线程用以监听客户端信息,根据信息头作不同处理。

1. hashMap1存放客户端信息,hashMap2存放用户聊天记录Message.
2. 将Target当做标志位,接收到USER_LOGIN标识后,调用Login方法,解析data中存储的用户名和密码。
3. 一般标志位,则将Message存入Map2
4. 接收到USER_QUERY标识后,调用QUERY方法,遍历Map2中该用户的聊天记录。
1. hashMap1存放客户端信息,chatList存放用户聊天记录Message.
2. 将Target当做标志位,接收到Server标识后,调用Query()方法,查询聊天记录。
3. 一般标志位,则将Message存入chatList

## 4. 客户端:共有两个线程,一个线程用来监听服务器发来的信息,一个线程用于从控制台读取输入。

1. 创建客户端对象,通过TCP协议链接Server
2. 注册登录LOGIN()
3. 信息接收read()接收Message后,输出为 dataSource : data
4. 聊天记录QUERY()
2. 消息格式:用户名|内容
3. 当用户名为Server时,查询聊天记录。



Expand Down
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
<artifactId>hutool-all</artifactId>
<version>5.8.15</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>5.0.0.Alpha2</version>
</dependency>

</dependencies>

Expand Down

0 comments on commit 848a9a4

Please sign in to comment.