mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-04 02:26:11 +08:00
📝 破防了,不整zenuml了
This commit is contained in:
parent
3c090db0cb
commit
69ef94bcf5
@ -67,58 +67,25 @@ class WeiboSite(CookieSite):
|
|||||||
|
|
||||||
目前整体的调度逻辑是:
|
目前整体的调度逻辑是:
|
||||||
|
|
||||||
<script type="module" >
|
|
||||||
import mermaid from "mermaid";
|
|
||||||
import zenuml from "@mermaid-js/mermaid-zenuml";
|
|
||||||
async function initializeMermaid() {
|
|
||||||
await mermaid.registerExternalDiagrams([zenuml]);
|
|
||||||
}
|
|
||||||
initializeMermaid();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<pre class="mermaid">zenuml
|
|
||||||
title Cookie调度逻辑
|
|
||||||
Scheduler #661ae6
|
|
||||||
Platform #2b2d30
|
|
||||||
CookieClientManager #FFEBE6
|
|
||||||
DB #f26522
|
|
||||||
Internet #0747A6
|
|
||||||
@Starter(Scheduler)
|
|
||||||
Scheduler.exec_fetch{
|
|
||||||
Post = Platform.do_fetch_new_post(SubUnit) {
|
|
||||||
Platform.get_sub_list(Target){
|
|
||||||
client = CookieClientManager.get_client(Target){
|
|
||||||
cookie = CookieClientManager._choose_cookie(Target) {
|
|
||||||
cookies = DB.get_cookies()
|
|
||||||
}
|
|
||||||
client = CookieClientManager._assemble_client(Target, cookie)
|
|
||||||
}
|
|
||||||
res = Internet.client.get(Target)
|
|
||||||
CookieClientManager._response_hook(){
|
|
||||||
DB.update_cookie()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
flowchart TB
|
sequenceDiagram
|
||||||
init[初始化] --> schedule_pool[调度池]
|
participant Scheduler
|
||||||
schedule_pool((调度池)) --> choose_platform[选择Platform]
|
participant Platform
|
||||||
choose_platform --> get_targets[获取Target列表]
|
participant CookieClientManager
|
||||||
get_targets --> get_rawposts[获取Target的RawPost列表]
|
participant DB
|
||||||
get_rawposts --> compare_with_old[(与上次状态对比)]
|
participant Internet
|
||||||
compare_with_old -- 有新增 --> dispatch[分发到对应用户]
|
|
||||||
compare_with_old -- 无新增 --> schedule_pool
|
Scheduler->>Platform: exec_fetch
|
||||||
dispatch --> user_filter[用户订阅过滤]
|
Platform->>Platform: do_fetch_new_post(SubUnit)
|
||||||
user_filter -- 不匹配 --> schedule_pool
|
Platform->>Platform: get_sub_list(Target)
|
||||||
user_filter -- 匹配 --> parse[选择Post解析方式]
|
Platform->>CookieClientManager: get_client(Target)
|
||||||
parse -.-> to_text((文本Post))
|
CookieClientManager->>DB: get_cookies()
|
||||||
parse -.-> to_pic((图片Post))
|
CookieClientManager->>CookieClientManager: _choose_cookie(Target)
|
||||||
parse -.-> to_other((...))
|
CookieClientManager->>CookieClientManager: _assemble_client(Target, cookie)
|
||||||
to_text -.-> message_render[消息渲染]
|
CookieClientManager->>Platform: client
|
||||||
to_pic -.-> message_render
|
Platform->>Internet: client.get(Target)
|
||||||
to_other -.-> message_render
|
Internet->>Platform: response
|
||||||
message_render --> send_to[发送到对应用户]
|
Platform->>CookieClientManager: _response_hook()
|
||||||
|
CookieClientManager->>DB: update_cookie()
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -11,10 +11,8 @@
|
|||||||
"docs:update-package": "pnpm dlx vp-update"
|
"docs:update-package": "pnpm dlx vp-update"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@mermaid-js/mermaid-zenuml": "0.2.0",
|
|
||||||
"@vuepress/bundler-vite": "2.0.0-rc.17",
|
"@vuepress/bundler-vite": "2.0.0-rc.17",
|
||||||
"mermaid": "^11.3.0",
|
"mermaid": "^11.3.0",
|
||||||
"sass-embedded": "^1.79.5",
|
|
||||||
"vue": "^3.5.6",
|
"vue": "^3.5.6",
|
||||||
"vuepress": "2.0.0-rc.17",
|
"vuepress": "2.0.0-rc.17",
|
||||||
"vuepress-plugin-md-enhance": "2.0.0-rc.57",
|
"vuepress-plugin-md-enhance": "2.0.0-rc.57",
|
||||||
|
1198
pnpm-lock.yaml
generated
1198
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user