feat: 增强好友信息采集并更新应用主题

- 新增好友通过后自动采集微信号、企业、部门等详细信息并上传服务端
- 单聊消息列表新增联系人详细信息字段
- 更新应用名称为AwinWorkTool并统一相关文本显示
- 重构颜色配置,采用AI风格青色主题,提升视觉体验
- 更新后端协议文档,补充好友信息和消息列表的数据结构说明
This commit is contained in:
2026-03-24 17:44:47 +08:00
parent 344c0ad710
commit 51f961bb8e
8 changed files with 329 additions and 25 deletions

View File

@@ -166,3 +166,133 @@ WorkTool 使用 WebSocket 协议与服务端进行长连接通信。
* 8: 链接 (TEXT_TYPE_LINK)
* 9: 文件 (TEXT_TYPE_FILE)
* 15: 引用回复 (TEXT_TYPE_REPLY)
## 附录:自动通过好友请求
当 APP 开启"自动通过好友请求"开关后,有新好友添加成功时会主动上传好友信息到服务端。
### 上传时机
* 自动通过好友请求成功后
* 手动通过好友请求成功后
### 消息类型
* **Type**: `502` (GET_FRIEND_INFO)
### 数据结构
```json
{
"type": 502,
"friend": {
"name": "张三", // 好友昵称
"newFriend": true, // 标记为新好友
"wechatId": "zhangsan123", // 微信号
"phone": "13800138000", // 手机号
"corpName": "XX科技有限公司", // 企业名称
"department": "技术部", // 部门
"position": "工程师", // 职位
"email": "zhangsan@example.com", // 邮箱
"markName": "张工", // 备注名
"gender": 1, // 性别: 1男 2女 0未知
"leavingMsg": "请求添加好友时的留言" // 留言/验证消息
}
}
```
### 服务端接收示例
服务端只需监听 WebSocket 消息,当 `type=502``friend.newFriend=true` 时,表示有新好友添加成功。
---
## 附录:接收消息列表 (101)
客户端监听到新消息时,会主动上传消息列表到服务端。
### 消息类型
* **Type**: `101` (TYPE_RECEIVE_MESSAGE_LIST)
### 数据结构(群聊)
```json
{
"type": 101,
"roomType": 1,
"titleList": ["技术交流群"],
"messageList": [
{
"sender": 0,
"textType": 1,
"nameList": ["张三"],
"itemMessageList": [
{"feature": 2, "text": "你好,这是消息内容"}
]
},
{
"sender": 1,
"textType": 1,
"itemMessageList": [
{"feature": 2, "text": "收到"}
]
}
]
}
```
### 数据结构(单聊)
```json
{
"type": 101,
"roomType": 2,
"titleList": ["张三"],
"contact": {
"name": "张三",
"wechatId": "zhangsan123",
"phone": "13800138000",
"corpName": "XX科技有限公司",
"department": "技术部",
"position": "工程师",
"email": "zhangsan@example.com",
"markName": "张工"
},
"messageList": [
{
"sender": 0,
"textType": 1,
"itemMessageList": [
{"feature": 2, "text": "你好"}
]
}
]
}
```
### 字段说明
| 字段 | 类型 | 说明 |
|------|------|------|
| type | int | 消息类型101=接收的消息列表 |
| roomType | int | 房间类型1=外部群, 2=外部联系人, 3=内部群, 4=内部联系人 |
| titleList | Array | 聊天对象名称(群名或好友名) |
| contact | Object | 联系人信息(仅单聊时有效) |
| messageList | Array | 消息列表 |
### messageList 每条消息
| 字段 | 类型 | 说明 |
|------|------|------|
| sender | int | 发送者0=其他人, 1=自己, 2=系统消息 |
| textType | int | 消息类型1=文本, 2=图片, 3=语音, 5=视频, 8=链接, 9=文件 |
| nameList | Array | 发送者名称列表(群聊时有效) |
| itemMessageList | Array | 消息内容列表 |
### contact 联系人信息
| 字段 | 类型 | 说明 |
|------|------|------|
| name | String | 好友昵称 |
| wechatId | String | 微信号 |
| phone | String | 手机号 |
| corpName | String | 企业名称 |
| department | String | 部门 |
| position | String | 职位 |
| email | String | 邮箱 |
| markName | String | 备注名 |
| gender | int | 性别1=男, 2=女, 0=未知 |