Skip to content

fix: 套餐和密钥只能新增不能删除 - #5

Open
webbrain-one wants to merge 1 commit into
aa2013:masterfrom
webbrain-one:webbrain/issue-4
Open

fix: 套餐和密钥只能新增不能删除#5
webbrain-one wants to merge 1 commit into
aa2013:masterfrom
webbrain-one:webbrain/issue-4

Conversation

@webbrain-one

Copy link
Copy Markdown

Closes #4

Add missing web management controls to allow deletion of plans and API keys. Closes aa2013#4
@aa2013

aa2013 commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution!

I reviewed the changes, but this PR does not fully implement delete support yet. It currently only adds frontend-side buttons/API wrappers.

Main issues:

  1. There are no backend routes for the new requests:

    • POST /admin/plan/delete
    • POST /admin/planKeys/delete

    The current backend only registers add/edit/list/updateStatus/generate/list/verify endpoints, so these delete requests will fail.

  2. There are no DB-layer delete methods for plans or plan keys.
    We would need something like:

    • DeletePlan(id string)
    • DeletePlanKey(id int)
  3. The plan key delete API wrapper is added, but it does not appear to be used in the plan key table UI. The key list page still only has view/status actions.

  4. Deleting plans probably needs additional business logic:

    • Should plan keys under that plan be deleted too?
    • Should enabled plans be blocked from deletion?
    • Should active connections using deleted keys be disconnected?
    • Should related caches be refreshed?

So I don’t think this PR is ready to merge yet. Could you please add the backend implementation and wire up the plan key delete UI as well?


感谢贡献!

我看了一下,这个 PR 目前还没有完整实现删除功能,主要只是加了前端按钮和请求封装。

目前的问题是:

  1. 后端没有对应的删除接口:

    • /admin/plan/delete
    • /admin/planKeys/delete
  2. DB 层也没有删除套餐或删除密钥的方法。

  3. deletePlanKey 这个前端请求方法虽然加了,但密钥列表页面里没有删除按钮,也没有实际调用它。

  4. 删除套餐还需要考虑一些业务逻辑,比如是否级联删除套餐下的密钥、启用中的套餐是否允许删除、在线连接是否需要断开等。

所以这个 PR 现在还不能合并。麻烦补齐后端接口、数据库删除逻辑,以及密钥删除的前端交互后再更新一下。

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.

套餐和密钥只能新增不能删除

2 participants