Files
one-pipe-system/openspec/changes/rename-series-allocation-id-to-series-id/proposal.md
sexygoat 06cde977ad
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 2m36s
fetch(modify):修复角色分配权限
2026-02-02 17:08:49 +08:00

33 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Change: 重命名 API 字段 series_allocation_id 为 series_id
## Why
后端 API 字段命名不一致。前端表单使用 `series_id`套餐系列ID但 API 参数仍使用 `series_allocation_id`套餐系列分配ID。这导致命名混淆且不符合实际业务含义现在直接指向套餐系列 ID而非分配记录 ID
## What Changes
- **BREAKING**: 重命名 4 个 API 端点的请求/响应字段
- `PATCH /api/admin/iot-cards/series-binding` - 请求参数 `series_allocation_id``series_id`
- `PATCH /api/admin/devices/series-binding` - 请求参数 `series_allocation_id``series_id`
- `GET /api/admin/iot-cards/standalone` - 查询参数和响应字段 `series_allocation_id``series_id`
- `GET /api/admin/devices` - 查询参数和响应字段 `series_allocation_id``series_id`
- 前端同步修改:
- TypeScript 类型定义
- API 方法参数
- 页面组件调用代码
- 移除临时注释
## Impact
- **Affected specs**: iot-card-api, device-api
- **Affected code**:
- `src/types/api/device.ts` (BatchSetDeviceSeriesBindingRequest)
- `src/types/api/card.ts` (BatchSetCardSeriesBindingRequest)
- `src/api/modules/device.ts` (batchSetDeviceSeriesBinding)
- `src/api/modules/card.ts` (batchSetCardSeriesBinding)
- `src/views/asset-management/device-list/index.vue`
- `src/views/asset-management/iot-card-management/index.vue`
- **Breaking change**: 需要后端先部署更新,前端再部署
- **Migration**: 更新所有使用这些字段的 API 调用