refactor: 重写现有QQBot插件
4
API.md
@ -445,7 +445,7 @@ pnpm qqbot-plugin install-local <packageFile>
|
|||||||
|
|
||||||
### BangDream
|
### BangDream
|
||||||
|
|
||||||
插件 key:`bangDream`。当前源码根目录为 `src/qqbot/plugins/bangDream`,不再使用旧 `tsugu` 子目录。
|
插件 key:`bangdream`。旧 `bangDream` 作为兼容别名仍可解析;当前源码根目录为 `src/modules/qqbot/plugins/bangDream`,不再使用旧 `tsugu` 子目录。
|
||||||
|
|
||||||
| operation key | 命令 | 说明 |
|
| operation key | 命令 | 说明 |
|
||||||
| ----------------------------- | ------------- | ------------------------ |
|
| ----------------------------- | ------------- | ------------------------ |
|
||||||
@ -469,7 +469,7 @@ pnpm qqbot-plugin install-local <packageFile>
|
|||||||
|
|
||||||
### FF14 Market
|
### FF14 Market
|
||||||
|
|
||||||
插件 key:`ff14Market`。
|
插件 key:`ff14-market`。旧 `ff14Market` 作为兼容别名仍可解析。
|
||||||
|
|
||||||
| operation key | 说明 |
|
| operation key | 说明 |
|
||||||
| ------------------- | ------------------------------------------ |
|
| ------------------- | ------------------------------------------ |
|
||||||
|
|||||||
@ -158,7 +158,7 @@ API 暴露 `GET /health/runtime` 作为本地 smoke、Jenkins/K8s 和 ktWorkflow
|
|||||||
- NapCat 账号新增/编辑支持可选 QQ 登录密码:Admin 只提交 RSA-OAEP 加密后的 `encryptedLoginPassword`,后端解密后必须用显式配置的 `QQBOT_ACCOUNT_SECRET_KEY`(或非默认 `ADMIN_TOKEN_SECRET`)二次加密保存到 `qqbot_account.napcat_login_password_secret`;空值、`change-me` 和历史公开默认值会被拒绝;列表和详情不回显密码,日志会脱敏密码字段。
|
- NapCat 账号新增/编辑支持可选 QQ 登录密码:Admin 只提交 RSA-OAEP 加密后的 `encryptedLoginPassword`,后端解密后必须用显式配置的 `QQBOT_ACCOUNT_SECRET_KEY`(或非默认 `ADMIN_TOKEN_SECRET`)二次加密保存到 `qqbot_account.napcat_login_password_secret`;空值、`change-me` 和历史公开默认值会被拒绝;列表和详情不回显密码,日志会脱敏密码字段。
|
||||||
- NapCat 容器为已知 `selfId` 创建/重建时会注入 `ACCOUNT` 环境变量启用 `-q` 快速登录:容器重启(崩溃/重启策略/宿主重启)能从持久化会话免扫码自动重登;硬踢 `登录已失效` 会话作废仍需扫码。已绑定但缺少 `ACCOUNT` 的旧容器在下一次「更新登录」时原地重建一次补齐(保留 QQ 数据卷),`docker inspect` 已带 `ACCOUNT` 则跳过,重建失败不阻断登录。`ACCOUNT` 只负责指定快速登录账号;如果数据卷内没有该 QQ 的历史登录记录,后端会跳过快速登录并优先尝试账号保存的登录密码,密码登录会按 `QQBOT_NAPCAT_PASSWORD_LOGIN_WAIT_MS` / `QQBOT_NAPCAT_LOGIN_POLL_INTERVAL_MS` 轮询结果,准备中的扫码会话会续期,避免后台密码登录未结束时前端先过期;如果 NapCat 返回 `proofWaterUrl` 或日志出现“需要验证码”,会保持会话 pending 并把腾讯验证码结果 `ticket`/`randstr`/`sid` 通过 `/qqbot/account/scan/captcha/submit` 回交到同一容器的 `/api/QQLogin/CaptchaLogin`,不是让用户只打开外链;密码登录成功后会移除运行态 `NAPCAT_QUICK_PASSWORD`,清理失败则本次登录失败,避免成功态残留明文 env;密码登录也失败、验证码未完成、离线、账号不匹配或缺少 QQ 号时才重置登录态并生成二维码。Admin「更新登录」的 SSE 步骤顺序按实际路径为 `quick-login-*`(已有历史会话)-> `password-login-*` / `password-login-captcha` -> `password-env-cleanup` -> `relogin-reset/qrcode/waiting-scan`。
|
- NapCat 容器为已知 `selfId` 创建/重建时会注入 `ACCOUNT` 环境变量启用 `-q` 快速登录:容器重启(崩溃/重启策略/宿主重启)能从持久化会话免扫码自动重登;硬踢 `登录已失效` 会话作废仍需扫码。已绑定但缺少 `ACCOUNT` 的旧容器在下一次「更新登录」时原地重建一次补齐(保留 QQ 数据卷),`docker inspect` 已带 `ACCOUNT` 则跳过,重建失败不阻断登录。`ACCOUNT` 只负责指定快速登录账号;如果数据卷内没有该 QQ 的历史登录记录,后端会跳过快速登录并优先尝试账号保存的登录密码,密码登录会按 `QQBOT_NAPCAT_PASSWORD_LOGIN_WAIT_MS` / `QQBOT_NAPCAT_LOGIN_POLL_INTERVAL_MS` 轮询结果,准备中的扫码会话会续期,避免后台密码登录未结束时前端先过期;如果 NapCat 返回 `proofWaterUrl` 或日志出现“需要验证码”,会保持会话 pending 并把腾讯验证码结果 `ticket`/`randstr`/`sid` 通过 `/qqbot/account/scan/captcha/submit` 回交到同一容器的 `/api/QQLogin/CaptchaLogin`,不是让用户只打开外链;密码登录成功后会移除运行态 `NAPCAT_QUICK_PASSWORD`,清理失败则本次登录失败,避免成功态残留明文 env;密码登录也失败、验证码未完成、离线、账号不匹配或缺少 QQ 号时才重置登录态并生成二维码。Admin「更新登录」的 SSE 步骤顺序按实际路径为 `quick-login-*`(已有历史会话)-> `password-login-*` / `password-login-captcha` -> `password-env-cleanup` -> `relogin-reset/qrcode/waiting-scan`。
|
||||||
- NapCat 离线看门狗按 `QQBOT_NAPCAT_WATCHDOG_INTERVAL_MS`(默认 `120000`,最小 `30000`,`QQBOT_NAPCAT_WATCHDOG_ENABLED=false` 关闭)定时巡检在线账号,使掉线/被踢无需管理员打开列表页即可及时发现;检测到离线后先尝试 `ACCOUNT` 历史会话快速登录,再尝试账号保存的登录密码,仍失败时写入离线原因并复用 `super` 站内信告警;看门狗不自动进入扫码阶段。
|
- NapCat 离线看门狗按 `QQBOT_NAPCAT_WATCHDOG_INTERVAL_MS`(默认 `120000`,最小 `30000`,`QQBOT_NAPCAT_WATCHDOG_ENABLED=false` 关闭)定时巡检在线账号,使掉线/被踢无需管理员打开列表页即可及时发现;检测到离线后先尝试 `ACCOUNT` 历史会话快速登录,再尝试账号保存的登录密码,仍失败时写入离线原因并复用 `super` 站内信告警;看门狗不自动进入扫码阶段。
|
||||||
- BangDream 当前源码根目录是 `src/qqbot/plugins/bangDream`;不要恢复旧 `tsugu` 层级或旧大桶目录。
|
- BangDream 当前源码根目录是 `src/modules/qqbot/plugins/bangDream`;不要恢复旧 `tsugu` 层级或旧大桶目录。
|
||||||
- BangDream 在线命令以 `registry/operation-registry.ts` 为单一来源,新增命令必须同步 SQL/在线命令表并跑 registry/command-SQL 测试。
|
- BangDream 在线命令以 `registry/operation-registry.ts` 为单一来源,新增命令必须同步 SQL/在线命令表并跑 registry/command-SQL 测试。
|
||||||
- BangDream event stage 大图必须保持分页拆图行为,线上 smoke 关注 `imageCount=5`,避免大 canvas OOM 回归。
|
- BangDream event stage 大图必须保持分页拆图行为,线上 smoke 关注 `imageCount=5`,避免大 canvas OOM 回归。
|
||||||
|
|
||||||
@ -194,4 +194,4 @@ BangDream 图片能力改动:
|
|||||||
|
|
||||||
| 一级来源 | 使用方式 | License |
|
| 一级来源 | 使用方式 | License |
|
||||||
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------- |
|
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------- |
|
||||||
| [Tsugu BangDream Bot](https://github.com/Yamamoto-2/tsugu-bangdream-bot) | BangDream QQBot 后端能力已重构合入 `src/qqbot/plugins/bangDream`,保留本地 `TSUGU-LICENSE` | MIT |
|
| [Tsugu BangDream Bot](https://github.com/Yamamoto-2/tsugu-bangdream-bot) | BangDream QQBot 后端能力已重构合入 `src/modules/qqbot/plugins/bangDream`,保留本地 `TSUGU-LICENSE` | MIT |
|
||||||
|
|||||||
@ -1195,15 +1195,15 @@ git -C D:\MyFiles\KT\Vue\kt-template-admin commit -m "feat: 增加QQBot插件管
|
|||||||
- Create/modify: `D:\MyFiles\KT\Node\kt-template-online-api\src\modules\qqbot\plugins\bangDream\**`
|
- Create/modify: `D:\MyFiles\KT\Node\kt-template-online-api\src\modules\qqbot\plugins\bangDream\**`
|
||||||
- Test: `D:\MyFiles\KT\Node\kt-template-online-api\test\modules\qqbot\plugins\bangDream\**`
|
- Test: `D:\MyFiles\KT\Node\kt-template-online-api\test\modules\qqbot\plugins\bangDream\**`
|
||||||
|
|
||||||
- [ ] **Step 1: Preserve business directories**
|
- [x] **Step 1: Preserve business directories**
|
||||||
|
|
||||||
Keep business capabilities in `song`, `card`, `character`, `event`, `gacha`, `player`, `cutoff`, `catalog`, with cross-cutting code only in `application`, `registry`, `hook`, `provider`, `policy`, `theme`, `config`, `dictionary`, `search`, `shared`.
|
Keep business capabilities in `song`, `card`, `character`, `event`, `gacha`, `player`, `cutoff`, `catalog`, with cross-cutting code only in `application`, `registry`, `hook`, `provider`, `policy`, `theme`, `config`, `dictionary`, `search`, `shared`.
|
||||||
|
|
||||||
- [ ] **Step 2: Convert operation registry to manifest metadata**
|
- [x] **Step 2: Convert operation registry to manifest metadata**
|
||||||
|
|
||||||
Keep operation keys and aliases stable. `handlerName` becomes worker-internal.
|
Keep operation keys and aliases stable. `handlerName` becomes worker-internal.
|
||||||
|
|
||||||
- [ ] **Step 3: Verify BangDream**
|
- [x] **Step 3: Verify BangDream**
|
||||||
|
|
||||||
Run:
|
Run:
|
||||||
|
|
||||||
@ -1214,6 +1214,8 @@ pnpm --dir D:\MyFiles\KT\Node\kt-template-online-api run typecheck
|
|||||||
|
|
||||||
Expected: PASS. Event stage smoke keeps `imageCount=5`.
|
Expected: PASS. Event stage smoke keeps `imageCount=5`.
|
||||||
|
|
||||||
|
Actual note: BangDream moved to `src/modules/qqbot/plugins/bangDream` with the approved business and cross-cutting directory layout preserved. Added `plugin.json` with platform key `bangdream`; manifest operations are asserted against `BANGDREAM_OPERATION_REGISTRY` for stable operation keys, aliases, names, and worker-internal `handlerName`. Runtime registry now uses platform key `bangdream` as primary while resolving legacy `bangDream`; `/qqbot/plugin/*` local HTTP smoke now proves the controller returns platform keys and resolves legacy `bangDream` to `bangdream`. Verification passed via focused registry/command SQL Jest, plugin migration contract, QQBot core module contract path guard, plugin controller HTTP smoke, `pnpm run typecheck`, and `scripts/bangdream-render-smoke.ps1 -OperationKey bangdream.event.stage -Text 310`, which produced `imageCount=5`.
|
||||||
|
|
||||||
### Task 6.2: Rewrite FF14 Market, FFLogs, and Repeater
|
### Task 6.2: Rewrite FF14 Market, FFLogs, and Repeater
|
||||||
|
|
||||||
**Files:**
|
**Files:**
|
||||||
@ -1225,19 +1227,19 @@ Expected: PASS. Event stage smoke keeps `imageCount=5`.
|
|||||||
- Test: `D:\MyFiles\KT\Node\kt-template-online-api\test\modules\qqbot\plugins\fflogs\**`
|
- Test: `D:\MyFiles\KT\Node\kt-template-online-api\test\modules\qqbot\plugins\fflogs\**`
|
||||||
- Test: `D:\MyFiles\KT\Node\kt-template-online-api\test\modules\qqbot\plugins\repeater\**`
|
- Test: `D:\MyFiles\KT\Node\kt-template-online-api\test\modules\qqbot\plugins\repeater\**`
|
||||||
|
|
||||||
- [ ] **Step 1: FF14 Market**
|
- [x] **Step 1: FF14 Market**
|
||||||
|
|
||||||
Use host runtime HTTP SDK for external requests. No direct axios client in plugin code.
|
Use host runtime HTTP SDK for external requests. No direct axios client in plugin code.
|
||||||
|
|
||||||
- [ ] **Step 2: FFLogs**
|
- [x] **Step 2: FFLogs**
|
||||||
|
|
||||||
Use plugin config for credential references. No real secret in manifest, tests, docs, or commits.
|
Use plugin config for credential references. No real secret in manifest, tests, docs, or commits.
|
||||||
|
|
||||||
- [ ] **Step 3: Repeater**
|
- [x] **Step 3: Repeater**
|
||||||
|
|
||||||
Use host send queue and account binding. Do not bypass rate limit.
|
Use host send queue and account binding. Do not bypass rate limit.
|
||||||
|
|
||||||
- [ ] **Step 4: Verify**
|
- [x] **Step 4: Verify**
|
||||||
|
|
||||||
Run:
|
Run:
|
||||||
|
|
||||||
@ -1248,6 +1250,8 @@ pnpm --dir D:\MyFiles\KT\Node\kt-template-online-api run typecheck
|
|||||||
|
|
||||||
Expected: PASS.
|
Expected: PASS.
|
||||||
|
|
||||||
|
Actual note: FF14 Market, FFLogs, and Repeater moved to `src/modules/qqbot/plugins/*` and each now has a platform `plugin.json`. FF14 Market uses platform key `ff14-market` with legacy `ff14Market` compatibility and delegates outbound requests through `QqbotPluginHttpClientService`; FFLogs delegates outbound requests through the same host SDK and keeps credential references in manifest config schema without real secrets; Repeater remains event-plugin driven through host account binding and send queue services. Verification passed via focused plugin Jest, migration direct-HTTP scan for FF14/FFLogs, `/qqbot/plugin/list` and `/qqbot/plugin/operation/list` local HTTP smoke, and `pnpm run typecheck`; final focused Jest covered 9 suites / 27 tests.
|
||||||
|
|
||||||
### Task 6.3: Commit Batch 6
|
### Task 6.3: Commit Batch 6
|
||||||
|
|
||||||
Run:
|
Run:
|
||||||
|
|||||||
@ -48,8 +48,8 @@ const path = require("path");
|
|||||||
const { ConfigService } = require("@nestjs/config");
|
const { ConfigService } = require("@nestjs/config");
|
||||||
const payload = JSON.parse(Buffer.from("$PayloadBase64", "base64").toString("utf8"));
|
const payload = JSON.parse(Buffer.from("$PayloadBase64", "base64").toString("utf8"));
|
||||||
const { ToolsService } = require("./src/common/services/tool.service");
|
const { ToolsService } = require("./src/common/services/tool.service");
|
||||||
const { QqbotBangDreamRendererService } = require("./src/qqbot/plugins/bangDream/application/bangdream-renderer.facade");
|
const { QqbotBangDreamRendererService } = require("./src/modules/qqbot/plugins/bangDream/application/bangdream-renderer.facade");
|
||||||
const { TsuguApplicationService } = require("./src/qqbot/plugins/bangDream/application/bangdream-application.service");
|
const { TsuguApplicationService } = require("./src/modules/qqbot/plugins/bangDream/application/bangdream-application.service");
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const renderer = new QqbotBangDreamRendererService(new ConfigService({}), undefined);
|
const renderer = new QqbotBangDreamRendererService(new ConfigService({}), undefined);
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import { QqbotDashboardService } from '@/qqbot/dashboard/qqbot-dashboard.service
|
|||||||
import { QqbotDedupe } from '@/qqbot/dedupe/qqbot-dedupe.entity';
|
import { QqbotDedupe } from '@/qqbot/dedupe/qqbot-dedupe.entity';
|
||||||
import { QqbotDedupeService } from '@/qqbot/dedupe/qqbot-dedupe.service';
|
import { QqbotDedupeService } from '@/qqbot/dedupe/qqbot-dedupe.service';
|
||||||
import { QqbotEventService } from '@/qqbot/event/qqbot-event.service';
|
import { QqbotEventService } from '@/qqbot/event/qqbot-event.service';
|
||||||
|
import { QqbotPluginHttpClientService } from '@/modules/qqbot/plugin-platform/sdk';
|
||||||
import { QqbotConversation } from '@/qqbot/message/qqbot-conversation.entity';
|
import { QqbotConversation } from '@/qqbot/message/qqbot-conversation.entity';
|
||||||
import { QqbotMessageController } from '@/qqbot/message/qqbot-message.controller';
|
import { QqbotMessageController } from '@/qqbot/message/qqbot-message.controller';
|
||||||
import { QqbotMessage } from '@/qqbot/message/qqbot-message.entity';
|
import { QqbotMessage } from '@/qqbot/message/qqbot-message.entity';
|
||||||
@ -39,15 +40,15 @@ import { QqbotPermissionService } from '@/qqbot/permission/qqbot-permission.serv
|
|||||||
import { QqbotEventPluginRegistryService } from '@/qqbot/plugin/qqbot-event-plugin-registry.service';
|
import { QqbotEventPluginRegistryService } from '@/qqbot/plugin/qqbot-event-plugin-registry.service';
|
||||||
import { QqbotPluginController } from '@/qqbot/plugin/qqbot-plugin.controller';
|
import { QqbotPluginController } from '@/qqbot/plugin/qqbot-plugin.controller';
|
||||||
import { QqbotPluginRegistryService } from '@/qqbot/plugin/qqbot-plugin-registry.service';
|
import { QqbotPluginRegistryService } from '@/qqbot/plugin/qqbot-plugin-registry.service';
|
||||||
import { QqbotBangDreamClientService } from '@/qqbot/plugins/bangDream/application/bangdream-client.service';
|
import { QqbotBangDreamClientService } from '@/modules/qqbot/plugins/bangDream/application/bangdream-client.service';
|
||||||
import { TsuguApplicationService } from '@/qqbot/plugins/bangDream/application/bangdream-application.service';
|
import { TsuguApplicationService } from '@/modules/qqbot/plugins/bangDream/application/bangdream-application.service';
|
||||||
import { QqbotBangDreamRendererService } from '@/qqbot/plugins/bangDream/application/bangdream-renderer.facade';
|
import { QqbotBangDreamRendererService } from '@/modules/qqbot/plugins/bangDream/application/bangdream-renderer.facade';
|
||||||
import { QqbotBangDreamPluginService } from '@/qqbot/plugins/bangDream/qqbot-bangdream.plugin';
|
import { QqbotBangDreamPluginService } from '@/modules/qqbot/plugins/bangDream/qqbot-bangdream.plugin';
|
||||||
import { QqbotFf14ClientService } from '@/qqbot/plugins/ff14Market/qqbot-ff14-client.service';
|
import { QqbotFf14ClientService } from '@/modules/qqbot/plugins/ff14Market/qqbot-ff14-client.service';
|
||||||
import { QqbotFf14MarketPluginService } from '@/qqbot/plugins/ff14Market/qqbot-ff14-market.plugin';
|
import { QqbotFf14MarketPluginService } from '@/modules/qqbot/plugins/ff14Market/qqbot-ff14-market.plugin';
|
||||||
import { QqbotFflogsClientService } from '@/qqbot/plugins/fflogs/qqbot-fflogs-client.service';
|
import { QqbotFflogsClientService } from '@/modules/qqbot/plugins/fflogs/qqbot-fflogs-client.service';
|
||||||
import { QqbotFflogsPluginService } from '@/qqbot/plugins/fflogs/qqbot-fflogs.plugin';
|
import { QqbotFflogsPluginService } from '@/modules/qqbot/plugins/fflogs/qqbot-fflogs.plugin';
|
||||||
import { QqbotRepeaterPluginService } from '@/qqbot/plugins/repeater/qqbot-repeater.plugin';
|
import { QqbotRepeaterPluginService } from '@/modules/qqbot/plugins/repeater/qqbot-repeater.plugin';
|
||||||
import { QqbotRuleController } from '@/qqbot/rule/qqbot-rule.controller';
|
import { QqbotRuleController } from '@/qqbot/rule/qqbot-rule.controller';
|
||||||
import { QqbotRule } from '@/qqbot/rule/qqbot-rule.entity';
|
import { QqbotRule } from '@/qqbot/rule/qqbot-rule.entity';
|
||||||
import { QqbotRuleEngineService } from '@/qqbot/rule/qqbot-rule-engine.service';
|
import { QqbotRuleEngineService } from '@/qqbot/rule/qqbot-rule-engine.service';
|
||||||
@ -97,6 +98,7 @@ export const QQBOT_CORE_PROVIDERS = [
|
|||||||
QqbotDashboardService,
|
QqbotDashboardService,
|
||||||
QqbotDedupeService,
|
QqbotDedupeService,
|
||||||
QqbotEventService,
|
QqbotEventService,
|
||||||
|
QqbotPluginHttpClientService,
|
||||||
QqbotBangDreamClientService,
|
QqbotBangDreamClientService,
|
||||||
QqbotBangDreamPluginService,
|
QqbotBangDreamPluginService,
|
||||||
QqbotBangDreamRendererService,
|
QqbotBangDreamRendererService,
|
||||||
|
|||||||
@ -4,14 +4,15 @@ import { AdminAuthGuardModule } from '@/admin/auth/admin-auth-guard.module';
|
|||||||
import { QqbotPluginPlatformController } from './plugin-platform.controller';
|
import { QqbotPluginPlatformController } from './plugin-platform.controller';
|
||||||
import { QqbotPluginPlatformService } from './plugin-platform.service';
|
import { QqbotPluginPlatformService } from './plugin-platform.service';
|
||||||
import { QQBOT_PLUGIN_PLATFORM_ENTITIES } from './persistence';
|
import { QQBOT_PLUGIN_PLATFORM_ENTITIES } from './persistence';
|
||||||
|
import { QqbotPluginHttpClientService } from './sdk';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
controllers: [QqbotPluginPlatformController],
|
controllers: [QqbotPluginPlatformController],
|
||||||
exports: [QqbotPluginPlatformService],
|
exports: [QqbotPluginHttpClientService, QqbotPluginPlatformService],
|
||||||
imports: [
|
imports: [
|
||||||
AdminAuthGuardModule,
|
AdminAuthGuardModule,
|
||||||
TypeOrmModule.forFeature([...QQBOT_PLUGIN_PLATFORM_ENTITIES]),
|
TypeOrmModule.forFeature([...QQBOT_PLUGIN_PLATFORM_ENTITIES]),
|
||||||
],
|
],
|
||||||
providers: [QqbotPluginPlatformService],
|
providers: [QqbotPluginHttpClientService, QqbotPluginPlatformService],
|
||||||
})
|
})
|
||||||
export class QqbotPluginPlatformModule {}
|
export class QqbotPluginPlatformModule {}
|
||||||
|
|||||||
@ -1 +1,2 @@
|
|||||||
export * from './plugin-sdk';
|
export * from './plugin-sdk';
|
||||||
|
export * from './plugin-http-client.service';
|
||||||
|
|||||||
@ -0,0 +1,81 @@
|
|||||||
|
import { Injectable } from '@nestjs/common';
|
||||||
|
import * as http from 'node:http';
|
||||||
|
import * as https from 'node:https';
|
||||||
|
|
||||||
|
export type QqbotPluginHttpClientRequest = {
|
||||||
|
body?: Buffer | string;
|
||||||
|
context?: string;
|
||||||
|
failureMessage?: (statusCode: number) => string;
|
||||||
|
headers?: Record<string, string>;
|
||||||
|
invalidJsonMessage?: string;
|
||||||
|
method?: string;
|
||||||
|
timeoutMessage?: string;
|
||||||
|
timeoutMs?: number;
|
||||||
|
url: string | URL;
|
||||||
|
};
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class QqbotPluginHttpClientService {
|
||||||
|
async requestJson<T>(input: QqbotPluginHttpClientRequest): Promise<T> {
|
||||||
|
const body = await this.requestText(input);
|
||||||
|
try {
|
||||||
|
return JSON.parse(body) as T;
|
||||||
|
} catch {
|
||||||
|
throw new Error(
|
||||||
|
input.invalidJsonMessage ||
|
||||||
|
`${input.context || '插件 HTTP 接口'}返回不是合法 JSON`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
requestText(input: QqbotPluginHttpClientRequest): Promise<string> {
|
||||||
|
const url = input.url instanceof URL ? input.url : new URL(input.url);
|
||||||
|
const method = input.method || 'GET';
|
||||||
|
const timeoutMs = input.timeoutMs || 8000;
|
||||||
|
const context = input.context || '插件 HTTP 接口';
|
||||||
|
|
||||||
|
return new Promise<string>((resolve, reject) => {
|
||||||
|
const client = url.protocol === 'http:' ? http : https;
|
||||||
|
const request = client.request(
|
||||||
|
url,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
'User-Agent': 'kt-template-online-api/qqbot-plugin',
|
||||||
|
...(input.headers || {}),
|
||||||
|
},
|
||||||
|
method,
|
||||||
|
timeout: timeoutMs,
|
||||||
|
},
|
||||||
|
(response) => {
|
||||||
|
let responseBody = '';
|
||||||
|
response.setEncoding('utf8');
|
||||||
|
response.on('data', (chunk) => {
|
||||||
|
responseBody += chunk;
|
||||||
|
});
|
||||||
|
response.on('end', () => {
|
||||||
|
const statusCode = response.statusCode || 500;
|
||||||
|
if (statusCode >= 400) {
|
||||||
|
reject(
|
||||||
|
new Error(
|
||||||
|
input.failureMessage?.(statusCode) ||
|
||||||
|
`${context}请求失败:${statusCode}`,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
resolve(responseBody);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
request.on('timeout', () => {
|
||||||
|
request.destroy(
|
||||||
|
new Error(input.timeoutMessage || `${context}请求超时`),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
request.on('error', reject);
|
||||||
|
if (input.body) request.write(input.body);
|
||||||
|
request.end();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,15 +4,15 @@ import type {
|
|||||||
QqbotBangDreamCommandInput,
|
QqbotBangDreamCommandInput,
|
||||||
QqbotBangDreamCommandOutput,
|
QqbotBangDreamCommandOutput,
|
||||||
QqbotBangDreamOperationKey,
|
QqbotBangDreamOperationKey,
|
||||||
} from '@/qqbot/plugins/bangDream/qqbot-bangdream.types';
|
} from '@/modules/qqbot/plugins/bangDream/qqbot-bangdream.types';
|
||||||
import { waitForMainDataReady } from '@/qqbot/plugins/bangDream/shared/main-data-store';
|
import { waitForMainDataReady } from '@/modules/qqbot/plugins/bangDream/shared/main-data-store';
|
||||||
import {
|
import {
|
||||||
createTsuguLogHook,
|
createTsuguLogHook,
|
||||||
TsuguHookRegistry,
|
TsuguHookRegistry,
|
||||||
} from '@/qqbot/plugins/bangDream/hook/hook-registry';
|
} from '@/modules/qqbot/plugins/bangDream/hook/hook-registry';
|
||||||
import { getBangDreamOperationDefinition } from '@/qqbot/plugins/bangDream/registry/operation-registry';
|
import { getBangDreamOperationDefinition } from '@/modules/qqbot/plugins/bangDream/registry/operation-registry';
|
||||||
import { TsuguOperationPipeline } from '@/qqbot/plugins/bangDream/application/operation-pipeline';
|
import { TsuguOperationPipeline } from '@/modules/qqbot/plugins/bangDream/application/operation-pipeline';
|
||||||
import { QqbotBangDreamRendererService } from '@/qqbot/plugins/bangDream/application/bangdream-renderer.facade';
|
import { QqbotBangDreamRendererService } from '@/modules/qqbot/plugins/bangDream/application/bangdream-renderer.facade';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TsuguApplicationService implements OnApplicationBootstrap {
|
export class TsuguApplicationService implements OnApplicationBootstrap {
|
||||||
@ -4,8 +4,8 @@ import type {
|
|||||||
QqbotBangDreamOperationKey,
|
QqbotBangDreamOperationKey,
|
||||||
QqbotBangDreamSongSearchInput,
|
QqbotBangDreamSongSearchInput,
|
||||||
QqbotBangDreamSongSummary,
|
QqbotBangDreamSongSummary,
|
||||||
} from '@/qqbot/plugins/bangDream/qqbot-bangdream.types';
|
} from '@/modules/qqbot/plugins/bangDream/qqbot-bangdream.types';
|
||||||
import { TsuguApplicationService } from '@/qqbot/plugins/bangDream/application/bangdream-application.service';
|
import { TsuguApplicationService } from '@/modules/qqbot/plugins/bangDream/application/bangdream-application.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class QqbotBangDreamClientService {
|
export class QqbotBangDreamClientService {
|
||||||
@ -1,54 +1,59 @@
|
|||||||
import { Injectable, Optional } from '@nestjs/common';
|
import { Injectable, Optional } from '@nestjs/common';
|
||||||
import { ConfigService } from '@nestjs/config';
|
import { ConfigService } from '@nestjs/config';
|
||||||
import { DictService } from '@/admin/dict/dict.service';
|
import { DictService } from '@/admin/dict/dict.service';
|
||||||
import { Card } from '@/qqbot/plugins/bangDream/card/card.model';
|
import { Card } from '@/modules/qqbot/plugins/bangDream/card/card.model';
|
||||||
import { getPresentEvent } from '@/qqbot/plugins/bangDream/event/event.model';
|
import { getPresentEvent } from '@/modules/qqbot/plugins/bangDream/event/event.model';
|
||||||
import { Gacha, getPresentGachaList } from '@/qqbot/plugins/bangDream/gacha/gacha.model';
|
import {
|
||||||
|
Gacha,
|
||||||
|
getPresentGachaList,
|
||||||
|
} from '@/modules/qqbot/plugins/bangDream/gacha/gacha.model';
|
||||||
import {
|
import {
|
||||||
BANGDREAM_GACHA_DEFAULT_SPIN_COUNT,
|
BANGDREAM_GACHA_DEFAULT_SPIN_COUNT,
|
||||||
isBirthdayGachaType,
|
isBirthdayGachaType,
|
||||||
} from '@/qqbot/plugins/bangDream/policy/gacha.policy';
|
} from '@/modules/qqbot/plugins/bangDream/policy/gacha.policy';
|
||||||
import { Server } from '@/qqbot/plugins/bangDream/catalog/server.model';
|
import { Server } from '@/modules/qqbot/plugins/bangDream/catalog/server.model';
|
||||||
import { Song } from '@/qqbot/plugins/bangDream/song/song.model';
|
import { Song } from '@/modules/qqbot/plugins/bangDream/song/song.model';
|
||||||
import mainAPI, { waitForMainDataReady } from '@/qqbot/plugins/bangDream/shared/main-data-store';
|
import mainAPI, {
|
||||||
|
waitForMainDataReady,
|
||||||
|
} from '@/modules/qqbot/plugins/bangDream/shared/main-data-store';
|
||||||
import {
|
import {
|
||||||
fuzzySearch,
|
fuzzySearch,
|
||||||
type FuzzySearchResult,
|
type FuzzySearchResult,
|
||||||
} from '@/qqbot/plugins/bangDream/search/fuzzy-search';
|
} from '@/modules/qqbot/plugins/bangDream/search/fuzzy-search';
|
||||||
import { drawCardDetail } from '@/qqbot/plugins/bangDream/card/card-detail.renderer';
|
import { drawCardDetail } from '@/modules/qqbot/plugins/bangDream/card/card-detail.renderer';
|
||||||
import { drawCardList } from '@/qqbot/plugins/bangDream/card/card-search.renderer';
|
import { drawCardList } from '@/modules/qqbot/plugins/bangDream/card/card-search.renderer';
|
||||||
import { drawCharacterDetail } from '@/qqbot/plugins/bangDream/character/character-detail.renderer';
|
import { drawCharacterDetail } from '@/modules/qqbot/plugins/bangDream/character/character-detail.renderer';
|
||||||
import { drawCharacterList } from '@/qqbot/plugins/bangDream/character/character-search.renderer';
|
import { drawCharacterList } from '@/modules/qqbot/plugins/bangDream/character/character-search.renderer';
|
||||||
import { drawCutoffAll } from '@/qqbot/plugins/bangDream/cutoff/cutoff-all.renderer';
|
import { drawCutoffAll } from '@/modules/qqbot/plugins/bangDream/cutoff/cutoff-all.renderer';
|
||||||
import { drawCutoffDetail } from '@/qqbot/plugins/bangDream/cutoff/cutoff-detail.renderer';
|
import { drawCutoffDetail } from '@/modules/qqbot/plugins/bangDream/cutoff/cutoff-detail.renderer';
|
||||||
import { drawCutoffEventTop } from '@/qqbot/plugins/bangDream/cutoff/cutoff-event-top.renderer';
|
import { drawCutoffEventTop } from '@/modules/qqbot/plugins/bangDream/cutoff/cutoff-event-top.renderer';
|
||||||
import { drawCutoffListOfRecentEvent } from '@/qqbot/plugins/bangDream/cutoff/cutoff-recent.renderer';
|
import { drawCutoffListOfRecentEvent } from '@/modules/qqbot/plugins/bangDream/cutoff/cutoff-recent.renderer';
|
||||||
import { drawEventDetail } from '@/qqbot/plugins/bangDream/event/event-detail.renderer';
|
import { drawEventDetail } from '@/modules/qqbot/plugins/bangDream/event/event-detail.renderer';
|
||||||
import { drawEventList } from '@/qqbot/plugins/bangDream/event/event-search.renderer';
|
import { drawEventList } from '@/modules/qqbot/plugins/bangDream/event/event-search.renderer';
|
||||||
import { drawEventStage } from '@/qqbot/plugins/bangDream/event/event-stage.renderer';
|
import { drawEventStage } from '@/modules/qqbot/plugins/bangDream/event/event-stage.renderer';
|
||||||
import { drawGachaDetail } from '@/qqbot/plugins/bangDream/gacha/gacha-detail.renderer';
|
import { drawGachaDetail } from '@/modules/qqbot/plugins/bangDream/gacha/gacha-detail.renderer';
|
||||||
import { drawRandomGacha } from '@/qqbot/plugins/bangDream/gacha/gacha-simulate.renderer';
|
import { drawRandomGacha } from '@/modules/qqbot/plugins/bangDream/gacha/gacha-simulate.renderer';
|
||||||
import { drawPlayerDetail } from '@/qqbot/plugins/bangDream/player/player-detail.renderer';
|
import { drawPlayerDetail } from '@/modules/qqbot/plugins/bangDream/player/player-detail.renderer';
|
||||||
import { drawSongChart } from '@/qqbot/plugins/bangDream/song/song-chart.renderer';
|
import { drawSongChart } from '@/modules/qqbot/plugins/bangDream/song/song-chart.renderer';
|
||||||
import { drawSongDetail } from '@/qqbot/plugins/bangDream/song/song-detail.renderer';
|
import { drawSongDetail } from '@/modules/qqbot/plugins/bangDream/song/song-detail.renderer';
|
||||||
import { drawSongList } from '@/qqbot/plugins/bangDream/song/song-search.renderer';
|
import { drawSongList } from '@/modules/qqbot/plugins/bangDream/song/song-search.renderer';
|
||||||
import { drawSongMetaList } from '@/qqbot/plugins/bangDream/song/song-meta.renderer';
|
import { drawSongMetaList } from '@/modules/qqbot/plugins/bangDream/song/song-meta.renderer';
|
||||||
import { drawSongRandom } from '@/qqbot/plugins/bangDream/song/song-random.renderer';
|
import { drawSongRandom } from '@/modules/qqbot/plugins/bangDream/song/song-random.renderer';
|
||||||
import {
|
import {
|
||||||
BangDreamDictionaryLoader,
|
BangDreamDictionaryLoader,
|
||||||
type BangDreamDictionaryItem,
|
type BangDreamDictionaryItem,
|
||||||
} from '@/qqbot/plugins/bangDream/dictionary/dictionary-loader';
|
} from '@/modules/qqbot/plugins/bangDream/dictionary/dictionary-loader';
|
||||||
import type { QqbotBangDreamOperationHandlerName } from '@/qqbot/plugins/bangDream/registry/operation-registry';
|
import type { QqbotBangDreamOperationHandlerName } from '@/modules/qqbot/plugins/bangDream/registry/operation-registry';
|
||||||
import {
|
import {
|
||||||
BANGDREAM_TSUGU_ENV_KEYS,
|
BANGDREAM_TSUGU_ENV_KEYS,
|
||||||
normalizeBangDreamBoolean,
|
normalizeBangDreamBoolean,
|
||||||
splitBangDreamOptionList,
|
splitBangDreamOptionList,
|
||||||
} from '@/qqbot/plugins/bangDream/config/runtime-options';
|
} from '@/modules/qqbot/plugins/bangDream/config/runtime-options';
|
||||||
import type {
|
import type {
|
||||||
QqbotBangDreamCommandInput,
|
QqbotBangDreamCommandInput,
|
||||||
QqbotBangDreamCommandOutput,
|
QqbotBangDreamCommandOutput,
|
||||||
QqbotBangDreamOperationKey,
|
QqbotBangDreamOperationKey,
|
||||||
} from '@/qqbot/plugins/bangDream/qqbot-bangdream.types';
|
} from '@/modules/qqbot/plugins/bangDream/qqbot-bangdream.types';
|
||||||
|
|
||||||
const SOURCE_NAME = 'Tsugu BangDream Bot 内置源码';
|
const SOURCE_NAME = 'Tsugu BangDream Bot 内置源码';
|
||||||
|
|
||||||
@ -2,15 +2,15 @@ import type {
|
|||||||
QqbotBangDreamCommandInput,
|
QqbotBangDreamCommandInput,
|
||||||
QqbotBangDreamCommandOutput,
|
QqbotBangDreamCommandOutput,
|
||||||
QqbotBangDreamOperationKey,
|
QqbotBangDreamOperationKey,
|
||||||
} from '@/qqbot/plugins/bangDream/qqbot-bangdream.types';
|
} from '@/modules/qqbot/plugins/bangDream/qqbot-bangdream.types';
|
||||||
import type {
|
import type {
|
||||||
QqbotBangDreamOperationHandlerName,
|
QqbotBangDreamOperationHandlerName,
|
||||||
TsuguOperationDefinition,
|
TsuguOperationDefinition,
|
||||||
} from '@/qqbot/plugins/bangDream/registry/operation-registry';
|
} from '@/modules/qqbot/plugins/bangDream/registry/operation-registry';
|
||||||
import {
|
import {
|
||||||
createTsuguHookContext,
|
createTsuguHookContext,
|
||||||
type TsuguHookRegistry,
|
type TsuguHookRegistry,
|
||||||
} from '@/qqbot/plugins/bangDream/hook/hook-registry';
|
} from '@/modules/qqbot/plugins/bangDream/hook/hook-registry';
|
||||||
|
|
||||||
export type TsuguOperationPipelineOptions = {
|
export type TsuguOperationPipelineOptions = {
|
||||||
executeHandler: (
|
executeHandler: (
|
||||||
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 445 KiB After Width: | Height: | Size: 445 KiB |
|
Before Width: | Height: | Size: 594 KiB After Width: | Height: | Size: 594 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 524 B |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 223 B |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 457 B |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 804 B After Width: | Height: | Size: 804 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@ -1,18 +1,18 @@
|
|||||||
import { setFontStyle } from '@/qqbot/plugins/bangDream/theme/canvas-text';
|
import { setFontStyle } from '@/modules/qqbot/plugins/bangDream/theme/canvas-text';
|
||||||
import { Band } from '@/qqbot/plugins/bangDream/catalog/band.model';
|
import { Band } from '@/modules/qqbot/plugins/bangDream/catalog/band.model';
|
||||||
import { Attribute } from '@/qqbot/plugins/bangDream/catalog/attribute.model';
|
import { Attribute } from '@/modules/qqbot/plugins/bangDream/catalog/attribute.model';
|
||||||
import { Card } from '@/qqbot/plugins/bangDream/card/card.model';
|
import { Card } from '@/modules/qqbot/plugins/bangDream/card/card.model';
|
||||||
import { Image, Canvas, loadImage } from 'skia-canvas';
|
import { Image, Canvas, loadImage } from 'skia-canvas';
|
||||||
import { drawCardIconSkill } from '@/qqbot/plugins/bangDream/card/card-skill-text.renderer';
|
import { drawCardIconSkill } from '@/modules/qqbot/plugins/bangDream/card/card-skill-text.renderer';
|
||||||
import { Skill } from '@/qqbot/plugins/bangDream/catalog/skill.model';
|
import { Skill } from '@/modules/qqbot/plugins/bangDream/catalog/skill.model';
|
||||||
import { loadImageFromPath } from '@/qqbot/plugins/bangDream/theme/canvas-image';
|
import { loadImageFromPath } from '@/modules/qqbot/plugins/bangDream/theme/canvas-image';
|
||||||
import { getBangDreamAssetPath } from '@/qqbot/plugins/bangDream/theme/asset-manifest';
|
import { getBangDreamAssetPath } from '@/modules/qqbot/plugins/bangDream/theme/asset-manifest';
|
||||||
import { BANGDREAM_RENDER_THEME } from '@/qqbot/plugins/bangDream/theme/render-theme';
|
import { BANGDREAM_RENDER_THEME } from '@/modules/qqbot/plugins/bangDream/theme/render-theme';
|
||||||
import {
|
import {
|
||||||
BANGDREAM_CARD_ART_SPEC,
|
BANGDREAM_CARD_ART_SPEC,
|
||||||
BangDreamCardArtAttribute,
|
BangDreamCardArtAttribute,
|
||||||
} from '@/qqbot/plugins/bangDream/card/card-art.layout';
|
} from '@/modules/qqbot/plugins/bangDream/card/card-art.layout';
|
||||||
import { cardArtResourceRepository } from '@/qqbot/plugins/bangDream/card/card-art.repository';
|
import { cardArtResourceRepository } from '@/modules/qqbot/plugins/bangDream/card/card-art.repository';
|
||||||
|
|
||||||
const cardTypeIconList: { [type: string]: Image } = {};
|
const cardTypeIconList: { [type: string]: Image } = {};
|
||||||
const starList: { [type: string]: Image } = {};
|
const starList: { [type: string]: Image } = {};
|
||||||
@ -1,10 +1,10 @@
|
|||||||
import { bangDreamBestdoriProvider } from '@/qqbot/plugins/bangDream/provider/bestdori.provider';
|
import { bangDreamBestdoriProvider } from '@/modules/qqbot/plugins/bangDream/provider/bestdori.provider';
|
||||||
import type { BangDreamDataProvider } from '@/qqbot/plugins/bangDream/provider/bangdream-data-provider';
|
import type { BangDreamDataProvider } from '@/modules/qqbot/plugins/bangDream/provider/bangdream-data-provider';
|
||||||
import type { BangDreamCardArtAttribute } from '@/qqbot/plugins/bangDream/card/card-art.layout';
|
import type { BangDreamCardArtAttribute } from '@/modules/qqbot/plugins/bangDream/card/card-art.layout';
|
||||||
import {
|
import {
|
||||||
createCardIconFramePath,
|
createCardIconFramePath,
|
||||||
createCardIllustrationFramePath,
|
createCardIllustrationFramePath,
|
||||||
} from '@/qqbot/plugins/bangDream/card/card-art.layout';
|
} from '@/modules/qqbot/plugins/bangDream/card/card-art.layout';
|
||||||
|
|
||||||
export class CardArtResourceRepository {
|
export class CardArtResourceRepository {
|
||||||
constructor(
|
constructor(
|
||||||
@ -1,30 +1,30 @@
|
|||||||
import { Card } from '@/qqbot/plugins/bangDream/card/card.model';
|
import { Card } from '@/modules/qqbot/plugins/bangDream/card/card.model';
|
||||||
import { Skill } from '@/qqbot/plugins/bangDream/catalog/skill.model';
|
import { Skill } from '@/modules/qqbot/plugins/bangDream/catalog/skill.model';
|
||||||
import {
|
import {
|
||||||
drawList,
|
drawList,
|
||||||
drawListByServerList,
|
drawListByServerList,
|
||||||
drawListMerge,
|
drawListMerge,
|
||||||
} from '@/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
} from '@/modules/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
||||||
import { drawCardIllustration } from '@/qqbot/plugins/bangDream/card/card-art.renderer';
|
import { drawCardIllustration } from '@/modules/qqbot/plugins/bangDream/card/card-art.renderer';
|
||||||
import { drawSkillInList } from '@/qqbot/plugins/bangDream/card/card-skill-list.renderer';
|
import { drawSkillInList } from '@/modules/qqbot/plugins/bangDream/card/card-skill-list.renderer';
|
||||||
import { drawTimeInList } from '@/qqbot/plugins/bangDream/event/event-time.renderer';
|
import { drawTimeInList } from '@/modules/qqbot/plugins/bangDream/event/event-time.renderer';
|
||||||
import { drawCardPrefixInList } from '@/qqbot/plugins/bangDream/card/card-prefix.renderer';
|
import { drawCardPrefixInList } from '@/modules/qqbot/plugins/bangDream/card/card-prefix.renderer';
|
||||||
import { drawCardStatInList } from '@/qqbot/plugins/bangDream/card/card-stat.renderer';
|
import { drawCardStatInList } from '@/modules/qqbot/plugins/bangDream/card/card-stat.renderer';
|
||||||
import { drawCardListInList } from '@/qqbot/plugins/bangDream/card/card-icon.renderer';
|
import { drawCardListInList } from '@/modules/qqbot/plugins/bangDream/card/card-icon.renderer';
|
||||||
import { drawSdCharacterInList } from '@/qqbot/plugins/bangDream/card/card-sd-character.renderer';
|
import { drawSdCharacterInList } from '@/modules/qqbot/plugins/bangDream/card/card-sd-character.renderer';
|
||||||
import { drawEventDataBlock } from '@/qqbot/plugins/bangDream/shared/detail-block.renderer';
|
import { drawEventDataBlock } from '@/modules/qqbot/plugins/bangDream/shared/detail-block.renderer';
|
||||||
import { drawGachaDataBlock } from '@/qqbot/plugins/bangDream/shared/detail-block.renderer';
|
import { drawGachaDataBlock } from '@/modules/qqbot/plugins/bangDream/shared/detail-block.renderer';
|
||||||
import { Image, Canvas } from 'skia-canvas';
|
import { Image, Canvas } from 'skia-canvas';
|
||||||
import { Server } from '@/qqbot/plugins/bangDream/catalog/server.model';
|
import { Server } from '@/modules/qqbot/plugins/bangDream/catalog/server.model';
|
||||||
import { drawTitle } from '@/qqbot/plugins/bangDream/shared/title.renderer';
|
import { drawTitle } from '@/modules/qqbot/plugins/bangDream/shared/title.renderer';
|
||||||
import { createOutputFinalImages } from '@/qqbot/plugins/bangDream/theme/canvas-output';
|
import { createOutputFinalImages } from '@/modules/qqbot/plugins/bangDream/theme/canvas-output';
|
||||||
import { Event } from '@/qqbot/plugins/bangDream/event/event.model';
|
import { Event } from '@/modules/qqbot/plugins/bangDream/event/event.model';
|
||||||
import { Gacha } from '@/qqbot/plugins/bangDream/gacha/gacha.model';
|
import { Gacha } from '@/modules/qqbot/plugins/bangDream/gacha/gacha.model';
|
||||||
import {
|
import {
|
||||||
globalDefaultServer,
|
globalDefaultServer,
|
||||||
serverNameFullList,
|
serverNameFullList,
|
||||||
} from '@/qqbot/plugins/bangDream/config/runtime-config';
|
} from '@/modules/qqbot/plugins/bangDream/config/runtime-config';
|
||||||
import { DetailBlockBuilder } from '@/qqbot/plugins/bangDream/shared/detail-block.builder';
|
import { DetailBlockBuilder } from '@/modules/qqbot/plugins/bangDream/shared/detail-block.builder';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在QQBot 图片视图层中判断对象是否包含指定自有属性。
|
* 在QQBot 图片视图层中判断对象是否包含指定自有属性。
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { BANGDREAM_CARD_PRIORITY_TYPES } from '@/qqbot/plugins/bangDream/config/runtime-options';
|
import { BANGDREAM_CARD_PRIORITY_TYPES } from '@/modules/qqbot/plugins/bangDream/config/runtime-options';
|
||||||
|
|
||||||
export interface CardIconListSortTarget {
|
export interface CardIconListSortTarget {
|
||||||
cardId: number;
|
cardId: number;
|
||||||
@ -1,13 +1,13 @@
|
|||||||
import { drawList } from '@/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
import { drawList } from '@/modules/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
||||||
import { Canvas } from 'skia-canvas';
|
import { Canvas } from 'skia-canvas';
|
||||||
import { drawCardIcon } from '@/qqbot/plugins/bangDream/card/card-art.renderer';
|
import { drawCardIcon } from '@/modules/qqbot/plugins/bangDream/card/card-art.renderer';
|
||||||
import { Card } from '@/qqbot/plugins/bangDream/card/card.model';
|
import { Card } from '@/modules/qqbot/plugins/bangDream/card/card.model';
|
||||||
import {
|
import {
|
||||||
BANGDREAM_CARD_ICON_LIST_SPEC,
|
BANGDREAM_CARD_ICON_LIST_SPEC,
|
||||||
getCardIconListSpacing,
|
getCardIconListSpacing,
|
||||||
getCardIconListTextSize,
|
getCardIconListTextSize,
|
||||||
sortCardIconListCards,
|
sortCardIconListCards,
|
||||||
} from '@/qqbot/plugins/bangDream/card/card-icon.layout';
|
} from '@/modules/qqbot/plugins/bangDream/card/card-icon.layout';
|
||||||
|
|
||||||
interface CardIconInListOptions {
|
interface CardIconInListOptions {
|
||||||
key?: string;
|
key?: string;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { BANGDREAM_RENDER_THEME } from '@/qqbot/plugins/bangDream/theme/render-theme';
|
import { BANGDREAM_RENDER_THEME } from '@/modules/qqbot/plugins/bangDream/theme/render-theme';
|
||||||
|
|
||||||
export interface CardPrefixBandLogoSource {
|
export interface CardPrefixBandLogoSource {
|
||||||
height: number;
|
height: number;
|
||||||
@ -1,18 +1,18 @@
|
|||||||
import { Card } from '@/qqbot/plugins/bangDream/card/card.model';
|
import { Card } from '@/modules/qqbot/plugins/bangDream/card/card.model';
|
||||||
import { Canvas } from 'skia-canvas';
|
import { Canvas } from 'skia-canvas';
|
||||||
import { globalDefaultServer } from '@/qqbot/plugins/bangDream/config/runtime-config';
|
import { globalDefaultServer } from '@/modules/qqbot/plugins/bangDream/config/runtime-config';
|
||||||
import { Band } from '@/qqbot/plugins/bangDream/catalog/band.model';
|
import { Band } from '@/modules/qqbot/plugins/bangDream/catalog/band.model';
|
||||||
import { Character } from '@/qqbot/plugins/bangDream/character/character.model';
|
import { Character } from '@/modules/qqbot/plugins/bangDream/character/character.model';
|
||||||
import {
|
import {
|
||||||
Server,
|
Server,
|
||||||
getServerByPriority,
|
getServerByPriority,
|
||||||
} from '@/qqbot/plugins/bangDream/catalog/server.model';
|
} from '@/modules/qqbot/plugins/bangDream/catalog/server.model';
|
||||||
import { setFontStyle } from '@/qqbot/plugins/bangDream/theme/canvas-text';
|
import { setFontStyle } from '@/modules/qqbot/plugins/bangDream/theme/canvas-text';
|
||||||
import { drawRoundedRect } from '@/qqbot/plugins/bangDream/theme/canvas-rect';
|
import { drawRoundedRect } from '@/modules/qqbot/plugins/bangDream/theme/canvas-rect';
|
||||||
import {
|
import {
|
||||||
BANGDREAM_CARD_PREFIX_SPEC,
|
BANGDREAM_CARD_PREFIX_SPEC,
|
||||||
getCardPrefixBandLogoLayout,
|
getCardPrefixBandLogoLayout,
|
||||||
} from '@/qqbot/plugins/bangDream/card/card-prefix.layout';
|
} from '@/modules/qqbot/plugins/bangDream/card/card-prefix.layout';
|
||||||
|
|
||||||
let prefixBG: Canvas;
|
let prefixBG: Canvas;
|
||||||
/**
|
/**
|
||||||
@ -1,11 +1,11 @@
|
|||||||
import { Canvas, Image } from 'skia-canvas';
|
import { Canvas, Image } from 'skia-canvas';
|
||||||
import { drawList } from '@/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
import { drawList } from '@/modules/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
||||||
import { loadImageFromPath } from '@/qqbot/plugins/bangDream/theme/canvas-image';
|
import { loadImageFromPath } from '@/modules/qqbot/plugins/bangDream/theme/canvas-image';
|
||||||
import { getBangDreamAssetPath } from '@/qqbot/plugins/bangDream/theme/asset-manifest';
|
import { getBangDreamAssetPath } from '@/modules/qqbot/plugins/bangDream/theme/asset-manifest';
|
||||||
import {
|
import {
|
||||||
BANGDREAM_RARITY_LIST_SPEC,
|
BANGDREAM_RARITY_LIST_SPEC,
|
||||||
shouldUseTrainedRarityStar,
|
shouldUseTrainedRarityStar,
|
||||||
} from '@/qqbot/plugins/bangDream/card/card-rarity.layout';
|
} from '@/modules/qqbot/plugins/bangDream/card/card-rarity.layout';
|
||||||
|
|
||||||
interface RarityInListOptions {
|
interface RarityInListOptions {
|
||||||
key?: string;
|
key?: string;
|
||||||
@ -1,11 +1,11 @@
|
|||||||
import { bangDreamBestdoriProvider } from '@/qqbot/plugins/bangDream/provider/bestdori.provider';
|
import { bangDreamBestdoriProvider } from '@/modules/qqbot/plugins/bangDream/provider/bestdori.provider';
|
||||||
import type { BangDreamDataProvider } from '@/qqbot/plugins/bangDream/provider/bangdream-data-provider';
|
import type { BangDreamDataProvider } from '@/modules/qqbot/plugins/bangDream/provider/bangdream-data-provider';
|
||||||
import { formatNumber } from '@/qqbot/plugins/bangDream/shared/model-utils';
|
import { formatNumber } from '@/modules/qqbot/plugins/bangDream/shared/model-utils';
|
||||||
import {
|
import {
|
||||||
getServerByPriority,
|
getServerByPriority,
|
||||||
Server,
|
Server,
|
||||||
} from '@/qqbot/plugins/bangDream/catalog/server.model';
|
} from '@/modules/qqbot/plugins/bangDream/catalog/server.model';
|
||||||
import { globalDefaultServer } from '@/qqbot/plugins/bangDream/config/runtime-config';
|
import { globalDefaultServer } from '@/modules/qqbot/plugins/bangDream/config/runtime-config';
|
||||||
|
|
||||||
export interface CardResourceSource {
|
export interface CardResourceSource {
|
||||||
cardId: number;
|
cardId: number;
|
||||||
@ -1,13 +1,13 @@
|
|||||||
import { Costume } from '@/qqbot/plugins/bangDream/catalog/costume.model';
|
import { Costume } from '@/modules/qqbot/plugins/bangDream/catalog/costume.model';
|
||||||
import { Card } from '@/qqbot/plugins/bangDream/card/card.model';
|
import { Card } from '@/modules/qqbot/plugins/bangDream/card/card.model';
|
||||||
import { Canvas } from 'skia-canvas';
|
import { Canvas } from 'skia-canvas';
|
||||||
import { drawList } from '@/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
import { drawList } from '@/modules/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
||||||
import {
|
import {
|
||||||
BANGDREAM_CARD_SD_CHARACTER_SPEC,
|
BANGDREAM_CARD_SD_CHARACTER_SPEC,
|
||||||
getCardSdCharacterCropRects,
|
getCardSdCharacterCropRects,
|
||||||
getCardSdCharacterListLineHeight,
|
getCardSdCharacterListLineHeight,
|
||||||
getCardSdCharacterListTextSize,
|
getCardSdCharacterListTextSize,
|
||||||
} from '@/qqbot/plugins/bangDream/card/card-sd-character.layout';
|
} from '@/modules/qqbot/plugins/bangDream/card/card-sd-character.layout';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在图片布局层中绘制SD角色In列表。
|
* 在图片布局层中绘制SD角色In列表。
|
||||||
@ -1,19 +1,19 @@
|
|||||||
import { Card } from '@/qqbot/plugins/bangDream/card/card.model';
|
import { Card } from '@/modules/qqbot/plugins/bangDream/card/card.model';
|
||||||
import { Character } from '@/qqbot/plugins/bangDream/character/character.model';
|
import { Character } from '@/modules/qqbot/plugins/bangDream/character/character.model';
|
||||||
import {
|
import {
|
||||||
match,
|
match,
|
||||||
FuzzySearchResult,
|
FuzzySearchResult,
|
||||||
} from '@/qqbot/plugins/bangDream/search/fuzzy-search';
|
} from '@/modules/qqbot/plugins/bangDream/search/fuzzy-search';
|
||||||
import { Canvas } from 'skia-canvas';
|
import { Canvas } from 'skia-canvas';
|
||||||
import { drawCardIcon } from '@/qqbot/plugins/bangDream/card/card-art.renderer';
|
import { drawCardIcon } from '@/modules/qqbot/plugins/bangDream/card/card-art.renderer';
|
||||||
import { drawDataBlockHorizontal } from '@/qqbot/plugins/bangDream/shared/data-block.renderer';
|
import { drawDataBlockHorizontal } from '@/modules/qqbot/plugins/bangDream/shared/data-block.renderer';
|
||||||
import { stackImage } from '@/qqbot/plugins/bangDream/shared/image-stack';
|
import { stackImage } from '@/modules/qqbot/plugins/bangDream/shared/image-stack';
|
||||||
import { drawTitle } from '@/qqbot/plugins/bangDream/shared/title.renderer';
|
import { drawTitle } from '@/modules/qqbot/plugins/bangDream/shared/title.renderer';
|
||||||
import { outputEasyImages } from '@/qqbot/plugins/bangDream/theme/canvas-output';
|
import { outputEasyImages } from '@/modules/qqbot/plugins/bangDream/theme/canvas-output';
|
||||||
import { Server } from '@/qqbot/plugins/bangDream/catalog/server.model';
|
import { Server } from '@/modules/qqbot/plugins/bangDream/catalog/server.model';
|
||||||
import { globalDefaultServer } from '@/qqbot/plugins/bangDream/config/runtime-config';
|
import { globalDefaultServer } from '@/modules/qqbot/plugins/bangDream/config/runtime-config';
|
||||||
import { createTsuguEntityMatcher } from '@/qqbot/plugins/bangDream/search/entity-list-matcher';
|
import { createTsuguEntityMatcher } from '@/modules/qqbot/plugins/bangDream/search/entity-list-matcher';
|
||||||
import { cardRepository } from '@/qqbot/plugins/bangDream/card/card.repository';
|
import { cardRepository } from '@/modules/qqbot/plugins/bangDream/card/card.repository';
|
||||||
|
|
||||||
const maxWidth = 7000;
|
const maxWidth = 7000;
|
||||||
type CardAttribute = Card['attribute'];
|
type CardAttribute = Card['attribute'];
|
||||||
@ -1,13 +1,16 @@
|
|||||||
import { Skill } from '@/qqbot/plugins/bangDream/catalog/skill.model';
|
import { Skill } from '@/modules/qqbot/plugins/bangDream/catalog/skill.model';
|
||||||
import {
|
import {
|
||||||
Server,
|
Server,
|
||||||
getServerByPriority,
|
getServerByPriority,
|
||||||
} from '@/qqbot/plugins/bangDream/catalog/server.model';
|
} from '@/modules/qqbot/plugins/bangDream/catalog/server.model';
|
||||||
import { drawTipsInList, drawListByServerList } from '@/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
import {
|
||||||
import { stackImage } from '@/qqbot/plugins/bangDream/shared/image-stack';
|
drawTipsInList,
|
||||||
|
drawListByServerList,
|
||||||
|
} from '@/modules/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
||||||
|
import { stackImage } from '@/modules/qqbot/plugins/bangDream/shared/image-stack';
|
||||||
import { Canvas } from 'skia-canvas';
|
import { Canvas } from 'skia-canvas';
|
||||||
import { Card } from '@/qqbot/plugins/bangDream/card/card.model';
|
import { Card } from '@/modules/qqbot/plugins/bangDream/card/card.model';
|
||||||
import { globalDefaultServer } from '@/qqbot/plugins/bangDream/config/runtime-config';
|
import { globalDefaultServer } from '@/modules/qqbot/plugins/bangDream/config/runtime-config';
|
||||||
|
|
||||||
interface SkillInListOptions {
|
interface SkillInListOptions {
|
||||||
key?: string;
|
key?: string;
|
||||||
@ -1,14 +1,14 @@
|
|||||||
import { Skill } from '@/qqbot/plugins/bangDream/catalog/skill.model';
|
import { Skill } from '@/modules/qqbot/plugins/bangDream/catalog/skill.model';
|
||||||
import { Image, Canvas } from 'skia-canvas';
|
import { Image, Canvas } from 'skia-canvas';
|
||||||
import { drawTextWithImages } from '@/qqbot/plugins/bangDream/theme/canvas-text';
|
import { drawTextWithImages } from '@/modules/qqbot/plugins/bangDream/theme/canvas-text';
|
||||||
import { loadImageFromPath } from '@/qqbot/plugins/bangDream/theme/canvas-image';
|
import { loadImageFromPath } from '@/modules/qqbot/plugins/bangDream/theme/canvas-image';
|
||||||
import { getBangDreamAssetPath } from '@/qqbot/plugins/bangDream/theme/asset-manifest';
|
import { getBangDreamAssetPath } from '@/modules/qqbot/plugins/bangDream/theme/asset-manifest';
|
||||||
import { BANGDREAM_RENDER_THEME } from '@/qqbot/plugins/bangDream/theme/render-theme';
|
import { BANGDREAM_RENDER_THEME } from '@/modules/qqbot/plugins/bangDream/theme/render-theme';
|
||||||
import {
|
import {
|
||||||
BANGDREAM_SKILL_TEXT_SPEC,
|
BANGDREAM_SKILL_TEXT_SPEC,
|
||||||
BangDreamSkillIconKey,
|
BangDreamSkillIconKey,
|
||||||
createSkillTextFragments,
|
createSkillTextFragments,
|
||||||
} from '@/qqbot/plugins/bangDream/card/card-skill-text.layout';
|
} from '@/modules/qqbot/plugins/bangDream/card/card-skill-text.layout';
|
||||||
|
|
||||||
const skillIcon: Partial<Record<BangDreamSkillIconKey, Image>> = {};
|
const skillIcon: Partial<Record<BangDreamSkillIconKey, Image>> = {};
|
||||||
/**
|
/**
|
||||||
@ -1,19 +1,19 @@
|
|||||||
import { Canvas } from 'skia-canvas';
|
import { Canvas } from 'skia-canvas';
|
||||||
import { drawText } from '@/qqbot/plugins/bangDream/theme/canvas-text';
|
import { drawText } from '@/modules/qqbot/plugins/bangDream/theme/canvas-text';
|
||||||
import { drawList } from '@/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
import { drawList } from '@/modules/qqbot/plugins/bangDream/shared/list-frame.renderer';
|
||||||
import { stackImage } from '@/qqbot/plugins/bangDream/shared/image-stack';
|
import { stackImage } from '@/modules/qqbot/plugins/bangDream/shared/image-stack';
|
||||||
import { drawRoundedRect } from '@/qqbot/plugins/bangDream/theme/canvas-rect';
|
import { drawRoundedRect } from '@/modules/qqbot/plugins/bangDream/theme/canvas-rect';
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
Stat,
|
Stat,
|
||||||
limitBreakRankStat,
|
limitBreakRankStat,
|
||||||
} from '@/qqbot/plugins/bangDream/card/card.model';
|
} from '@/modules/qqbot/plugins/bangDream/card/card.model';
|
||||||
import { BANGDREAM_STAT_CONFIG } from '@/qqbot/plugins/bangDream/shared/bangdream-constants';
|
import { BANGDREAM_STAT_CONFIG } from '@/modules/qqbot/plugins/bangDream/shared/bangdream-constants';
|
||||||
import {
|
import {
|
||||||
BANGDREAM_STAT_LIST_SPEC,
|
BANGDREAM_STAT_LIST_SPEC,
|
||||||
createStatLineText,
|
createStatLineText,
|
||||||
getStatLineBarLayout,
|
getStatLineBarLayout,
|
||||||
} from '@/qqbot/plugins/bangDream/card/card-stat.layout';
|
} from '@/modules/qqbot/plugins/bangDream/card/card-stat.layout';
|
||||||
|
|
||||||
export const statConfig: Record<string, { color: string; name: string }> =
|
export const statConfig: Record<string, { color: string; name: string }> =
|
||||||
BANGDREAM_STAT_CONFIG;
|
BANGDREAM_STAT_CONFIG;
|
||||||
@ -1,18 +1,18 @@
|
|||||||
import { Skill } from '@/qqbot/plugins/bangDream/catalog/skill.model';
|
import { Skill } from '@/modules/qqbot/plugins/bangDream/catalog/skill.model';
|
||||||
import { Character } from '@/qqbot/plugins/bangDream/character/character.model';
|
import { Character } from '@/modules/qqbot/plugins/bangDream/character/character.model';
|
||||||
import {
|
import {
|
||||||
Server,
|
Server,
|
||||||
getServerByPriority,
|
getServerByPriority,
|
||||||
serverList,
|
serverList,
|
||||||
} from '@/qqbot/plugins/bangDream/catalog/server.model';
|
} from '@/modules/qqbot/plugins/bangDream/catalog/server.model';
|
||||||
import { Gacha } from '@/qqbot/plugins/bangDream/gacha/gacha.model';
|
import { Gacha } from '@/modules/qqbot/plugins/bangDream/gacha/gacha.model';
|
||||||
import { Event } from '@/qqbot/plugins/bangDream/event/event.model';
|
import { Event } from '@/modules/qqbot/plugins/bangDream/event/event.model';
|
||||||
import { Image, loadImage } from 'skia-canvas';
|
import { Image, loadImage } from 'skia-canvas';
|
||||||
import { bangDreamMainDataRepository } from '@/qqbot/plugins/bangDream/shared/main-data.repository';
|
import { bangDreamMainDataRepository } from '@/modules/qqbot/plugins/bangDream/shared/main-data.repository';
|
||||||
import { globalDefaultServer } from '@/qqbot/plugins/bangDream/config/runtime-config';
|
import { globalDefaultServer } from '@/modules/qqbot/plugins/bangDream/config/runtime-config';
|
||||||
import { stringToNumberArray } from '@/qqbot/plugins/bangDream/shared/model-utils';
|
import { stringToNumberArray } from '@/modules/qqbot/plugins/bangDream/shared/model-utils';
|
||||||
import { BANGDREAM_CARD_TYPE_NAME } from '@/qqbot/plugins/bangDream/shared/bangdream-constants';
|
import { BANGDREAM_CARD_TYPE_NAME } from '@/modules/qqbot/plugins/bangDream/shared/bangdream-constants';
|
||||||
import { cardResourceRepository } from '@/qqbot/plugins/bangDream/card/card-resource.repository';
|
import { cardResourceRepository } from '@/modules/qqbot/plugins/bangDream/card/card-resource.repository';
|
||||||
|
|
||||||
export interface Stat {
|
export interface Stat {
|
||||||
//综合力
|
//综合力
|
||||||