1111111

62 阅读4分钟

Private Message Controller 流程

序号日志备注
1privateMsgController getAll accountId获取所有 accountId
2privateMsgController getAll 账号数据获取账号数据
3privateMsgController getAll 账号数据为空 异常账号数据为空,抛出异常
4privateMsgController getAll catch error: 异常捕获异常

进入 getHistoryMsg

序号日志备注
5getHistoryMsg constructor success构造函数成功
6getHistoryMsg getHistoryMsg logFinderId:获取 logFinderId
7getHistoryMsg getHistoryMsg cookie:获取 cookie
8getHistoryMsg get-history-msg: 微信 get-history-msg 接口请求数据请求微信的 get-history-msg 接口,重要
9getHistoryMsg getHistoryMsg catch error 异常捕获异常
10getHistoryMsg getSessionInfo sessionIdArr获取 sessionIdArr
11getHistoryMsg get-session-info: 微信 get-session-info 接口请求数据请求微信的 get-session-info 接口,重要
12getHistoryMsg updateMsgUserList /private/msg/list/callback params mediaAccountId:请求 admin 接口参数
13getHistoryMsg updateMsgUserList /private/msg/list/callback params list:请求 admin 接口参数
14getHistoryMsg updateMsgUserList /private/msg/list/callback result请求 admin 结果
15getHistoryMsg updateMsgUserList /private/msg/list/callback params mediaAccountId:请求 admin 接口参数
16getHistoryMsg updateMsgUserList /private/msg/list/callback params list:请求 admin 接口参数
17getHistoryMsg updateMsgList /private/msg/list/callback result:请求 admin 结果
18getHistoryMsg getSessionInfo catch error捕获异常

Private Message Controller 开始监听流程

序号日志备注
0privateMsgController start AccountMap:启动 AccountMap
1privateMsgController start platform:启动平台
2privateMsgController start accountId:启动 accountId
3privateMsgController start task:启动任务
4privateMsgController start error 在AccountMap 没找到账号 异常在 AccountMap 没找到账号,抛出异常
5privateMsgController start catch error 异常捕获异常
6privateMsgController start task sendMessage puppeteer:listenerPrivateMsg cookie:发送任务消息,包含 cookie
7privateMsgController start task sendMessage puppeteer:listenerPrivateMsg finderUsername:发送任务消息,包含 finderUsername
8privateMsgController start task sendMessage puppeteer:listenerPrivateMsg accountId:发送任务消息,包含 accountId
9puppeteerWorkers index 接收到 puppeteer:listenerPrivateMsg data:准备进入 privateMsg 脚本

Private Message Work 脚本

序号日志备注
0puppeteerWorkers privateMsg listener msg:监听微信页面下行通知
1puppeteerWorkers privateMsg getCookie logFinderId:获取 logFinderId
2puppeteerWorkers privateMsg getCookie cookie:获取 cookie
3puppeteerWorkers privateMsg get-login-cookie error 异常获取登录 cookie 错误
4get-new-msg获取新消息
5puppeteerWorkers privateMsg get-new-msg loginCookie:获取新消息,包含 loginCookie
6puppeteerWorkers privateMsg get-new-msg logFinderId:获取新消息,包含 logFinderId
7puppeteerWorkers privateMsg get-new-msg cookie:获取新消息,包含 cookie
8puppeteerWorkers privateMsg get-new-msg data:从微信获取的新消息,重要
9puppeteerWorkers privateMsg get-new-msg 获取新消息失败 baseResp.errcode不为0 异常获取新消息失败,baseResp.errcode 不为 0
10puppeteerWorkers privateMsg get-new-msg catch error 异常捕获异常
11puppeteerWorkers privateMsg 更新 loginCookie:更新 loginCookie
12puppeteerWorkers privateMsg sendMessage privateMsg-newMsg data:发送新消息数据
13privateMsgController start handleMessage privateMsg-newMsg:controller 监听到新消息的回调
14privateMsgController start handleMessage privateMsg-newMsg error: 异常处理新消息错误
15getSessionInfo获取 session 信息
16puppeteerWorkers privateMsg getSessionInfo sessionIdArr:获取 sessionIdArr
17puppeteerWorkers privateMsg getSessionInfo logFinderId:获取 logFinderId
18puppeteerWorkers privateMsg getSessionInfo cookie:获取 cookie
19puppeteerWorkers privateMsg get-session-info data:从微信获取的 session,重要
20puppeteerWorkers privateMsg sendMessage get-session-info data:发送 session 数据给上层,重要

Controller 收到消息处理

序号日志备注
1privateMsgController start handleMessage privateMsg-sessionInfocontroller 层收到数据通知,重要
2privateMsgController start updateMsgUserList /private/msg/user/list:发送 session 数据回调给 server
3privateMsgController start updateMsgUserList /private/user/msg/user/list:发送 msg 数据回调给 server
4privateMsgController start Session sendTo /private/user/msg/list data:发送数据给 admin,重要
5privateMsgController start Session sendTo /private/msg/list mediaAccountId:发送 mediaAccountId 给 admin
6privateMsgController start handleMessage /private/msg/user/list error: 异常处理消息列表错误
7privateMsgController start handleMessage /private/user/msg/user/list error: 异常处理用户消息列表错误

initPrivateListen 收到消息处理

序号日志备注
1initPrivateListen 启动启动 initPrivateListen
2initPrivateListen 账号数据获取账号数据
3initPrivateListen handleMessage privateMsg-newMsg:监听到新消息的回调
4initPrivateListen handleMessage privateMsg-newMsg msgData:baseResp.errcode === 0 成功
5initPrivateListen handleMessage privateMsg-newMsg error 异常捕获异常
6initPrivateListen handleMessage privateMsg-sessionInfo从脚本获取数据通知,重要
7initPrivateListen updateMsgUserList /private/msg/user/list:请求 server 接口
8initPrivateListen updateMsgUserList handleMessage /private/msg/user/list error: 异常处理消息列表错误
9initPrivateListen updateMsgList /private/msg/list msgList:msgList 参数
10initPrivateListen updateMsgList /private/msg/list:更新消息列表
| 11 | initPrivateListen updateMsgList /private/msg/list sendTo privateMsg:newMsg:success: | 发送新消息数据给 admin,重要 |

| 12 | initPrivateListen updateMsgUserList handleMessage /private/msg/list error: | 处理消息列表错误,重要 |

Send

序号日志备注
1privateMsgController sendMsg context:发送消息 context
2privateMsgController sendMsg 账号数据:发送账号数据
3privateMsgController sendMsg 账号数据为空: 异常账号数据为空,抛出异常
4privateMsgController sendMsg context.Uid:发送消息 Uid
5privateMsgController sendMsg context.Data:发送消息 Data
6privateMsgController sendMsg cookieStr:发送消息 cookieStr
7privateMsgController sendMsg finderUsername:发送消息 finderUsername
8privateMsgController sendMsg catch error 异常捕获异常
9sendPrivateMsgTask constructor success构造函数成功
10sendPrivateMsgTask sendMessage data:发送给微信的数据,重要
11sendPrivateMsgTask send-private-msg data:微信的回调,重要
12sendPrivateMsgTask send-private-msg sendTo privateMsg:sendMsg:success:发送成功,发给 admin,重要
13sendPrivateMsgTask send-private-msg 发送消息失败 异常发送消息失败,抛出异常
14sendPrivateMsgTask send-private-msg catch error 异常捕获异常