feat(手机号资产关联): AUG26-009 手机号—资产关联、十项上限与后台解绑
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m2s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m2s
- 新增成对迁移 000223(tb_phone_asset_association,含有效关系部分唯一索引与 down 守卫)与 000224(解绑导入任务表),不回填历史 - H5:need_bind_phone 三支判定(开关关闭完全短路);已有主号幂等建联;十项上限按手机号 advisory 串行化(含换绑到全新号的并发场景);换绑原子迁移与冲突整单回滚;不写遗留列 - 后台:关联列表、单项/批量解绑、CSV 导入解绑(B1–B16),超管/平台 gate + 资产数据范围复核,三态统一文案 - 读侧:卡/设备列表与详情按页一次 IN 聚合;两类导出补「关联手机号」列并保留历史表头反解兼容 - 脱敏:关联审计走独立动作/资源只写脱敏手机号;访问日志手机号类字段脱敏 - 同步主 Spec openspec/specs/phone-asset-association 并归档 AUG26-009,补齐 requirement-evidence 与入口矩阵,context-health 通过
This commit is contained in:
@@ -2603,7 +2603,9 @@
|
||||
"capability": "personal-customer",
|
||||
"requirements": [
|
||||
"identity-access::令牌生命周期",
|
||||
"personal-customer::个人客户身份"
|
||||
"personal-customer::个人客户身份",
|
||||
"phone-asset-association::H5 验证建立关联与数量上限",
|
||||
"phone-asset-association::H5 绑定与换绑的关联写入"
|
||||
],
|
||||
"classification": "behavior"
|
||||
},
|
||||
@@ -2613,7 +2615,8 @@
|
||||
"capability": "personal-customer",
|
||||
"requirements": [
|
||||
"identity-access::令牌生命周期",
|
||||
"personal-customer::个人客户身份"
|
||||
"personal-customer::个人客户身份",
|
||||
"phone-asset-association::H5 绑定与换绑的关联写入"
|
||||
],
|
||||
"classification": "behavior"
|
||||
},
|
||||
@@ -2643,7 +2646,8 @@
|
||||
"capability": "personal-customer",
|
||||
"requirements": [
|
||||
"identity-access::令牌生命周期",
|
||||
"personal-customer::个人客户身份"
|
||||
"personal-customer::个人客户身份",
|
||||
"phone-asset-association::登录提示判定"
|
||||
],
|
||||
"classification": "behavior"
|
||||
},
|
||||
@@ -2663,7 +2667,8 @@
|
||||
"capability": "personal-customer",
|
||||
"requirements": [
|
||||
"identity-access::令牌生命周期",
|
||||
"personal-customer::个人客户身份"
|
||||
"personal-customer::个人客户身份",
|
||||
"phone-asset-association::登录提示判定"
|
||||
],
|
||||
"classification": "behavior"
|
||||
},
|
||||
@@ -2673,7 +2678,8 @@
|
||||
"capability": "personal-customer",
|
||||
"requirements": [
|
||||
"identity-access::令牌生命周期",
|
||||
"personal-customer::个人客户身份"
|
||||
"personal-customer::个人客户身份",
|
||||
"phone-asset-association::登录提示判定"
|
||||
],
|
||||
"classification": "behavior"
|
||||
},
|
||||
@@ -3427,7 +3433,9 @@
|
||||
"entry_type": "async",
|
||||
"entry": "constants.TaskTypeDeviceImport",
|
||||
"capability": "infrastructure",
|
||||
"requirements": [],
|
||||
"requirements": [
|
||||
"phone-asset-association::关联不影响换货与其他写入路径"
|
||||
],
|
||||
"classification": "route_index_or_infrastructure"
|
||||
},
|
||||
{
|
||||
@@ -3474,7 +3482,9 @@
|
||||
"entry_type": "async",
|
||||
"entry": "constants.TaskTypeIotCardImport",
|
||||
"capability": "infrastructure",
|
||||
"requirements": [],
|
||||
"requirements": [
|
||||
"phone-asset-association::关联不影响换货与其他写入路径"
|
||||
],
|
||||
"classification": "route_index_or_infrastructure"
|
||||
},
|
||||
{
|
||||
@@ -4139,5 +4149,69 @@
|
||||
"business-user-group::店铺负责人 CSV 导入"
|
||||
],
|
||||
"classification": "route_index_or_infrastructure"
|
||||
},
|
||||
{
|
||||
"entry_type": "http",
|
||||
"entry": "GET /api/admin/phone-asset-associations",
|
||||
"capability": "phone-asset-association",
|
||||
"requirements": [
|
||||
"phone-asset-association::后台查看关联"
|
||||
],
|
||||
"classification": "behavior"
|
||||
},
|
||||
{
|
||||
"entry_type": "http",
|
||||
"entry": "POST /api/admin/phone-asset-associations/batch-unbind",
|
||||
"capability": "phone-asset-association",
|
||||
"requirements": [
|
||||
"phone-asset-association::后台解除关联"
|
||||
],
|
||||
"classification": "behavior"
|
||||
},
|
||||
{
|
||||
"entry_type": "http",
|
||||
"entry": "POST /api/admin/phone-asset-associations/unbind-imports",
|
||||
"capability": "phone-asset-association",
|
||||
"requirements": [
|
||||
"phone-asset-association::后台解除关联"
|
||||
],
|
||||
"classification": "behavior"
|
||||
},
|
||||
{
|
||||
"entry_type": "http",
|
||||
"entry": "GET /api/admin/phone-asset-associations/unbind-imports",
|
||||
"capability": "phone-asset-association",
|
||||
"requirements": [
|
||||
"phone-asset-association::后台解除关联"
|
||||
],
|
||||
"classification": "behavior"
|
||||
},
|
||||
{
|
||||
"entry_type": "http",
|
||||
"entry": "GET /api/admin/phone-asset-associations/unbind-imports/{id}",
|
||||
"capability": "phone-asset-association",
|
||||
"requirements": [
|
||||
"phone-asset-association::后台解除关联",
|
||||
"phone-asset-association::后台查看关联"
|
||||
],
|
||||
"classification": "behavior"
|
||||
},
|
||||
{
|
||||
"entry_type": "http",
|
||||
"entry": "DELETE /api/admin/phone-asset-associations/{id}",
|
||||
"capability": "phone-asset-association",
|
||||
"requirements": [
|
||||
"phone-asset-association::后台解除关联"
|
||||
],
|
||||
"classification": "behavior"
|
||||
},
|
||||
{
|
||||
"entry_type": "async",
|
||||
"entry": "constants.TaskTypePhoneAssetUnbindImport",
|
||||
"capability": "phone-asset-association",
|
||||
"requirements": [
|
||||
"phone-asset-association::后台解除关联"
|
||||
],
|
||||
"classification": "behavior"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -3662,5 +3662,181 @@
|
||||
],
|
||||
"exit_status": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"capability": "phone-asset-association",
|
||||
"requirement": "H5 验证建立关联与数量上限",
|
||||
"spec": "openspec/specs/phone-asset-association/spec.md",
|
||||
"entries": [
|
||||
"POST /api/c/v1/auth/bind-phone"
|
||||
],
|
||||
"handler_consumer_job": [
|
||||
"internal/handler/app/client_auth.go",
|
||||
"internal/middleware/personal_auth.go"
|
||||
],
|
||||
"application_service_query": [
|
||||
"internal/service/client_auth/phone_asset_association.go",
|
||||
"internal/service/phone_asset_association/association_write.go"
|
||||
],
|
||||
"domain_state_amount": [
|
||||
"pkg/constants/phone_asset_association.go"
|
||||
],
|
||||
"store_migration_config": [
|
||||
"internal/store/postgres/phone_asset_association_store.go",
|
||||
"migrations/000223_add_phone_asset_association.up.sql"
|
||||
],
|
||||
"verification": {
|
||||
"command": "代码中检索 PhoneAssetAssociationMaxValidPerPhone",
|
||||
"literal_output": [
|
||||
"pkg/constants/phone_asset_association.go:32:\tPhoneAssetAssociationMaxValidPerPhone = 10"
|
||||
],
|
||||
"exit_status": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"capability": "phone-asset-association",
|
||||
"requirement": "登录提示判定",
|
||||
"spec": "openspec/specs/phone-asset-association/spec.md",
|
||||
"entries": [
|
||||
"POST /api/c/v1/auth/verify-asset"
|
||||
],
|
||||
"handler_consumer_job": [
|
||||
"internal/middleware/personal_auth.go"
|
||||
],
|
||||
"application_service_query": [
|
||||
"internal/service/client_auth/service.go"
|
||||
],
|
||||
"domain_state_amount": [
|
||||
"pkg/constants/phone_asset_association.go"
|
||||
],
|
||||
"store_migration_config": [
|
||||
"internal/store/postgres/phone_asset_association_store.go"
|
||||
],
|
||||
"verification": {
|
||||
"command": "代码中检索 needBindPhone = !associated",
|
||||
"literal_output": [
|
||||
"internal/service/client_auth/service.go:1031:\t\t\tneedBindPhone = !associated"
|
||||
],
|
||||
"exit_status": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"capability": "phone-asset-association",
|
||||
"requirement": "H5 绑定与换绑的关联写入",
|
||||
"spec": "openspec/specs/phone-asset-association/spec.md",
|
||||
"entries": [
|
||||
"POST /api/c/v1/auth/bind-phone",
|
||||
"POST /api/c/v1/auth/change-phone"
|
||||
],
|
||||
"handler_consumer_job": [
|
||||
"internal/handler/app/client_auth.go"
|
||||
],
|
||||
"application_service_query": [
|
||||
"internal/service/phone_asset_association/association_write.go"
|
||||
],
|
||||
"domain_state_amount": [
|
||||
"pkg/constants/phone_asset_association.go"
|
||||
],
|
||||
"store_migration_config": [
|
||||
"internal/store/postgres/phone_asset_association_store.go"
|
||||
],
|
||||
"verification": {
|
||||
"command": "代码中检索 换绑已回滚",
|
||||
"literal_output": [
|
||||
"internal/service/phone_asset_association/association_write.go:140:\t\t\treturn nil, errors.New(errors.CodeInvalidStatus, \"新手机号已存在与待迁移资产相同的有效关联,换绑已回滚\")"
|
||||
],
|
||||
"exit_status": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"capability": "phone-asset-association",
|
||||
"requirement": "后台查看关联",
|
||||
"spec": "openspec/specs/phone-asset-association/spec.md",
|
||||
"entries": [
|
||||
"GET /api/admin/phone-asset-associations"
|
||||
],
|
||||
"handler_consumer_job": [
|
||||
"internal/handler/admin/phone_asset_association.go",
|
||||
"internal/routes/phone_asset_association.go"
|
||||
],
|
||||
"application_service_query": [
|
||||
"internal/service/phone_asset_association/service.go",
|
||||
"internal/service/iot_card/service.go",
|
||||
"internal/service/device/service.go",
|
||||
"internal/exporter/association_phones.go"
|
||||
],
|
||||
"domain_state_amount": [
|
||||
"pkg/constants/phone_asset_association.go"
|
||||
],
|
||||
"store_migration_config": [
|
||||
"internal/store/postgres/phone_asset_association_store.go"
|
||||
],
|
||||
"verification": {
|
||||
"command": "代码中检索 ListValidByAssets(ctx",
|
||||
"literal_output": [
|
||||
"internal/service/iot_card/service.go:312:\tassociatedPhones, err := s.associationStore.ListValidByAssets(ctx, constants.AssetTypeIotCard, cardIDs)",
|
||||
"internal/service/device/service.go:273:\tassociatedPhones, err := s.associationStore.ListValidByAssets(ctx, constants.AssetTypeDevice, deviceIDs)"
|
||||
],
|
||||
"exit_status": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"capability": "phone-asset-association",
|
||||
"requirement": "后台解除关联",
|
||||
"spec": "openspec/specs/phone-asset-association/spec.md",
|
||||
"entries": [
|
||||
"DELETE /api/admin/phone-asset-associations/{id}",
|
||||
"POST /api/admin/phone-asset-associations/batch-unbind",
|
||||
"POST /api/admin/phone-asset-associations/unbind-imports",
|
||||
"GET /api/admin/phone-asset-associations/unbind-imports",
|
||||
"GET /api/admin/phone-asset-associations/unbind-imports/{id}"
|
||||
],
|
||||
"handler_consumer_job": [
|
||||
"internal/handler/admin/phone_asset_association.go"
|
||||
],
|
||||
"application_service_query": [
|
||||
"internal/service/phone_asset_association/service.go",
|
||||
"internal/task/phone_asset_unbind_import.go"
|
||||
],
|
||||
"domain_state_amount": [
|
||||
"pkg/constants/phone_asset_association.go"
|
||||
],
|
||||
"store_migration_config": [
|
||||
"internal/store/postgres/phone_asset_association_store.go",
|
||||
"migrations/000224_add_phone_asset_unbind_import_task.up.sql"
|
||||
],
|
||||
"verification": {
|
||||
"command": "代码中检索 PhoneAssetAssociationDeniedMessage",
|
||||
"literal_output": [
|
||||
"pkg/constants/phone_asset_association.go:103:\tPhoneAssetAssociationDeniedMessage = \"无权限操作该资源或资源不存在\"",
|
||||
"internal/service/phone_asset_association/service.go:267:\treturn errors.New(errors.CodeForbidden, constants.PhoneAssetAssociationDeniedMessage)"
|
||||
],
|
||||
"exit_status": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"capability": "phone-asset-association",
|
||||
"requirement": "关联不影响换货与其他写入路径",
|
||||
"spec": "openspec/specs/phone-asset-association/spec.md",
|
||||
"entries": [],
|
||||
"handler_consumer_job": [],
|
||||
"application_service_query": [],
|
||||
"domain_state_amount": [
|
||||
"pkg/constants/phone_asset_association.go"
|
||||
],
|
||||
"store_migration_config": [
|
||||
"internal/store/postgres/phone_asset_association_store.go"
|
||||
],
|
||||
"verification": {
|
||||
"command": "代码中检索 tb_phone_asset_association 的全部写入点(应仅本 Change 模块)",
|
||||
"literal_output": [
|
||||
"internal/service/phone_asset_association/association_write.go:75:\tcreated, err := store.CreateIfAbsent(ctx, tx, association)",
|
||||
"internal/service/phone_asset_association/association_write.go:136:\tif err := tx.WithContext(ctx).Model(&model.PhoneAssetAssociation{}).",
|
||||
"internal/service/phone_asset_association/service.go:65:\t\taffected, err := s.associationStore.WithTx(tx).InvalidateByIDs(ctx, tx, []uint{locked.ID},",
|
||||
"internal/service/phone_asset_association/service.go:147:\t\taffected, err := s.associationStore.WithTx(tx).InvalidateByIDs(ctx, tx, ids,",
|
||||
"internal/task/phone_asset_unbind_import.go:334:\t\taffected, err := h.associationStore.WithTx(tx).InvalidateByIDs(ctx, tx, ids,"
|
||||
],
|
||||
"exit_status": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user