Skip to content

chore(api): 重新生成 BetterGI 接口的前端 API 客户端 - #525

Merged
qiyinxi merged 1 commit into
AUTO-MAS-Project:devfrom
qiyinxi:chore/openapi-regen-bettergi-20260901
Sep 1, 2026
Merged

qiyinxi merged 1 commit into
AUTO-MAS-Project:devfrom
qiyinxi:chore/openapi-regen-bettergi-20260901

Conversation

@qiyinxi

@qiyinxi qiyinxi commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

概述

BetterGI 专项(#410)合入时没有重新跑 OpenAPI 生成器,frontend/src/api 与后端接口定义脱节。

变更

  • 重新生成前端 API 客户端:补齐三个 BetterGI 接口、修正一条龙自定义配置组的方法名与参数可选性、补齐 BetterGI 模型缺失的字段与导出。
  • 服务类名按生成器的 tag 派生结果统一为 BetterGiService(与 MaaFwServiceOknteService 同一规则),仓库里此前的 BettergiService 不是生成器产物;已用 git mv 完成大小写重命名,避免在大小写敏感环境下解析失败。
  • 同步更新两处消费方(useBettergiCustomGroups.tsBetterGIUserEdit.vue),后端与业务逻辑未改。

验证

yarn typecheckyarn lint --max-warnings 1yarn test(23 文件 / 144 用例)均通过。

Sourcery 摘要

重新生成 BetterGI 前端 API 客户端,以恢复与后端接口定义的一致性。

错误修复:

  • 将生成的 BetterGI 前端客户端与当前后端 API 契约同步,包括新增的 BetterGI 端点和模型字段。

增强功能:

  • 统一生成的 BetterGI 服务名称并更新其使用者。
  • 修正 BetterGI 自定义组和配置模型的签名、可选性及导出内容。

日常维护:

  • 重新生成前端 API 客户端并更新仓库版本元数据。
Original summary in English

Summary by Sourcery

Regenerate the BetterGI frontend API client to restore alignment with the backend interface definitions.

Bug Fixes:

  • Synchronize the generated BetterGI frontend client with the current backend API contract, including the newly available BetterGI endpoints and model fields.

Enhancements:

  • Standardize the generated BetterGI service name and update its consumers.
  • Correct BetterGI custom-group and configuration model signatures, optionality, and exports.

Chores:

  • Regenerate the frontend API client and update the repository version metadata.

BetterGI 专项(AUTO-MAS-Project#410)合入时未重新跑生成器,前端生成物与后端 schema 脱节:
Service.ts 缺三个 BetterGI 接口,自定义配置组方法名与后端 operationId 不符,
多个 BetterGI 模型缺字段、缺描述且参数可选性不对,index.ts 缺两个模型导出。

服务类名按生成器的 tag 派生规则统一为 BetterGiService(与 MaaFwService、
OknteService 同源),用 git mv 完成大小写重命名以适配大小写敏感文件系统,
并同步更新两处消费方。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @qiyinxi, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 15 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown

审查者指南

重新生成 BetterGI 前端 OpenAPI 客户端,补齐并修正接口、模型和类型导出,统一服务类命名,并同步更新两个前端调用方;后端与业务逻辑未变。

BetterGI 前端 API 调用时序图

sequenceDiagram
    participant BetterGIUserEdit
    participant useBettergiCustomGroups
    participant BetterGiService
    participant BetterGIAPI

    BetterGIUserEdit->>BetterGiService: getBettergiOneDragonConfigsApiApiScriptsBettergiOneDragonConfigsGet(scriptId)
    BetterGiService->>BetterGIAPI: GET /api/scripts/bettergi/one-dragon/configs
    BetterGIAPI-->>BetterGiService: ComboBoxOut
    BetterGiService-->>BetterGIUserEdit: config options

    BetterGIUserEdit->>BetterGiService: getBettergiStrategiesApiApiScriptsBettergiStrategiesGet(scriptId)
    BetterGiService->>BetterGIAPI: GET /api/scripts/bettergi/strategies
    BetterGIAPI-->>BetterGiService: ComboBoxOut
    BetterGiService-->>BetterGIUserEdit: strategy options

    useBettergiCustomGroups->>BetterGiService: getBettergiCustomGroupsApiApiScriptsBettergiOneDragonCustomGroupsGet(scriptId, configName, useMasConfig)
    BetterGiService->>BetterGIAPI: GET /api/scripts/bettergi/one-dragon/custom-groups
    BetterGIAPI-->>BetterGiService: BetterGICustomGroupsOut
    BetterGiService-->>useBettergiCustomGroups: custom groups
Loading

文件级变更

变更 详情 文件
重新生成并同步 BetterGI 前端 API 客户端,使接口、模型和导出与后端 OpenAPI 定义一致。
  • 新增 BetterGI 策略、自定义配置组和一条龙配置列表接口客户端方法,并更新请求参数、返回类型及必选性。
  • 补齐 BetterGI 配置模型字段和类型导出,修正自定义配置组响应数据的可选性及一条龙配置字段类型。
  • 将生成的服务类统一重命名为 BetterGiService,并同步 API 聚合导出。
frontend/src/api/index.ts
frontend/src/api/models/BetterGIConfig.ts
frontend/src/api/models/BetterGIConfig_Game.ts
frontend/src/api/models/BetterGIConfig_Info.ts
frontend/src/api/models/BetterGIConfig_Run.ts
frontend/src/api/models/BetterGICustomGroupOut.ts
frontend/src/api/models/BetterGICustomGroupsOut.ts
frontend/src/api/models/BetterGIUserConfig.ts
frontend/src/api/models/BetterGIUserConfig_Data.ts
frontend/src/api/models/BetterGIUserConfig_Info.ts
frontend/src/api/models/BetterGIUserConfig_Notify.ts
frontend/src/api/models/BetterGIUserConfig_OneDragon.ts
frontend/src/api/models/BetterGIUserConfig_Switch.ts
frontend/src/api/models/BetterGIUserConfig_Task.ts
frontend/src/api/services/BetterGiService.ts
frontend/src/api/services/Service.ts
迁移前端消费方以使用新的 BetterGiService API 和生成的方法名。
  • 更新自定义配置组 composable 调用重命名后的服务及自定义配置组接口。
  • 更新 BetterGI 用户编辑页加载一条龙配置和自动战斗策略的调用。
frontend/src/composables/useBettergiCustomGroups.ts
frontend/src/views/EditView/User/BetterGIUserEdit.vue
更新仓库版本元数据以反映本次客户端重新生成。
  • 调整版本信息文件。
res/version.json

提示与命令

与 Sourcery 交互

  • 触发新的审查: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 根据审查评论生成 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以回复 @sourcery-ai issue,根据该评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,随时重新生成标题。
  • 生成拉取请求摘要: 在拉取请求正文中任意位置写入 @sourcery-ai summary,即可在指定位置生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,随时重新生成摘要。
  • 生成审查者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时重新生成审查者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,此功能会很有用。
  • 忽略所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从新的审查开始,这一功能尤其有用——别忘了评论 @sourcery-ai review 以触发新的审查!

自定义你的使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审查者指南等。
  • 更改审查语言。
  • 添加、移除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

重新生成 BetterGI 前端 OpenAPI 客户端,补齐并修正接口、模型和类型导出,统一服务类命名,并同步更新两个前端调用方;后端与业务逻辑未变。

Sequence diagram for BetterGI frontend API calls

sequenceDiagram
    participant BetterGIUserEdit
    participant useBettergiCustomGroups
    participant BetterGiService
    participant BetterGIAPI

    BetterGIUserEdit->>BetterGiService: getBettergiOneDragonConfigsApiApiScriptsBettergiOneDragonConfigsGet(scriptId)
    BetterGiService->>BetterGIAPI: GET /api/scripts/bettergi/one-dragon/configs
    BetterGIAPI-->>BetterGiService: ComboBoxOut
    BetterGiService-->>BetterGIUserEdit: config options

    BetterGIUserEdit->>BetterGiService: getBettergiStrategiesApiApiScriptsBettergiStrategiesGet(scriptId)
    BetterGiService->>BetterGIAPI: GET /api/scripts/bettergi/strategies
    BetterGIAPI-->>BetterGiService: ComboBoxOut
    BetterGiService-->>BetterGIUserEdit: strategy options

    useBettergiCustomGroups->>BetterGiService: getBettergiCustomGroupsApiApiScriptsBettergiOneDragonCustomGroupsGet(scriptId, configName, useMasConfig)
    BetterGiService->>BetterGIAPI: GET /api/scripts/bettergi/one-dragon/custom-groups
    BetterGIAPI-->>BetterGiService: BetterGICustomGroupsOut
    BetterGiService-->>useBettergiCustomGroups: custom groups
Loading

File-Level Changes

Change Details Files
重新生成并同步 BetterGI 前端 API 客户端,使接口、模型和导出与后端 OpenAPI 定义一致。
  • 新增 BetterGI 策略、自定义配置组和一条龙配置列表接口客户端方法,并更新请求参数、返回类型及必选性。
  • 补齐 BetterGI 配置模型字段和类型导出,修正自定义配置组响应数据的可选性及一条龙配置字段类型。
  • 将生成的服务类统一重命名为 BetterGiService,并同步 API 聚合导出。
frontend/src/api/index.ts
frontend/src/api/models/BetterGIConfig.ts
frontend/src/api/models/BetterGIConfig_Game.ts
frontend/src/api/models/BetterGIConfig_Info.ts
frontend/src/api/models/BetterGIConfig_Run.ts
frontend/src/api/models/BetterGICustomGroupOut.ts
frontend/src/api/models/BetterGICustomGroupsOut.ts
frontend/src/api/models/BetterGIUserConfig.ts
frontend/src/api/models/BetterGIUserConfig_Data.ts
frontend/src/api/models/BetterGIUserConfig_Info.ts
frontend/src/api/models/BetterGIUserConfig_Notify.ts
frontend/src/api/models/BetterGIUserConfig_OneDragon.ts
frontend/src/api/models/BetterGIUserConfig_Switch.ts
frontend/src/api/models/BetterGIUserConfig_Task.ts
frontend/src/api/services/BetterGiService.ts
frontend/src/api/services/Service.ts
迁移前端消费方以使用新的 BetterGiService API 和生成的方法名。
  • 更新自定义配置组 composable 调用重命名后的服务及自定义配置组接口。
  • 更新 BetterGI 用户编辑页加载一条龙配置和自动战斗策略的调用。
frontend/src/composables/useBettergiCustomGroups.ts
frontend/src/views/EditView/User/BetterGIUserEdit.vue
更新仓库版本元数据以反映本次客户端重新生成。
  • 调整版本信息文件。
res/version.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@qiyinxi
qiyinxi merged commit dd67355 into AUTO-MAS-Project:dev Sep 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant