feat: 添加设备IMEI和单卡ICCID查询接口
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled

- 新增 GET /api/admin/devices/by-imei/:imei 接口,支持通过设备号查询设备详情
- 新增 GET /api/admin/iot-cards/by-iccid/:iccid 接口,支持通过ICCID查询单卡详情
- 添加对应的 Service 层方法和 Handler
- 更新 OpenAPI 文档
- 添加集成测试并修复测试环境配置(使用环境变量)
- 归档已完成的 OpenSpec 变更记录

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-27 09:59:54 +08:00
parent ce0783f96e
commit 477a9fc98d
28 changed files with 1159 additions and 19 deletions

View File

@@ -1085,6 +1085,15 @@ components:
total_count:
description: 总数
type: integer
warning_count:
description: 警告数(部分成功的设备数量)
type: integer
warning_items:
description: 警告记录详情(部分成功的设备及其卡绑定失败原因)
items:
$ref: '#/components/schemas/DtoDeviceImportResultItemDTO'
nullable: true
type: array
type: object
DtoDeviceImportTaskResponse:
properties:
@@ -1136,6 +1145,9 @@ components:
total_count:
description: 总数
type: integer
warning_count:
description: 警告数(部分成功的设备数量)
type: integer
type: object
DtoDeviceResponse:
properties:
@@ -1577,6 +1589,83 @@ components:
description: 总数
type: integer
type: object
DtoIotCardDetailResponse:
properties:
activated_at:
description: 激活时间
format: date-time
nullable: true
type: string
activation_status:
description: 激活状态 (0:未激活, 1:已激活)
type: integer
batch_no:
description: 批次号
type: string
card_category:
description: 卡业务类型 (normal:普通卡, industry:行业卡)
type: string
card_type:
description: 卡类型
type: string
carrier_id:
description: 运营商ID
minimum: 0
type: integer
carrier_name:
description: 运营商名称
type: string
cost_price:
description: 成本价(分)
type: integer
created_at:
description: 创建时间
format: date-time
type: string
data_usage_mb:
description: 累计流量使用(MB)
type: integer
distribute_price:
description: 分销价(分)
type: integer
iccid:
description: ICCID
type: string
id:
description: 卡ID
minimum: 0
type: integer
imsi:
description: IMSI
type: string
msisdn:
description: 卡接入号
type: string
network_status:
description: 网络状态 (0:停机, 1:开机)
type: integer
real_name_status:
description: 实名状态 (0:未实名, 1:已实名)
type: integer
shop_id:
description: 店铺ID
minimum: 0
nullable: true
type: integer
shop_name:
description: 店铺名称
type: string
status:
description: 状态 (1:在库, 2:已分销, 3:已激活, 4:已停用)
type: integer
supplier:
description: 供应商
type: string
updated_at:
description: 更新时间
format: date-time
type: string
type: object
DtoListAssetAllocationRecordResponse:
properties:
list:
@@ -4904,6 +4993,52 @@ paths:
summary: 批量分配设备
tags:
- 设备管理
/api/admin/devices/by-imei/{imei}:
get:
parameters:
- description: 设备号(IMEI)
in: path
name: imei
required: true
schema:
description: 设备号(IMEI)
type: string
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/DtoDeviceResponse'
description: OK
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 请求参数错误
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 未认证或认证已过期
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 无权访问
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 服务器内部错误
security:
- BearerAuth: []
summary: 通过设备号查询设备详情
tags:
- 设备管理
/api/admin/devices/import:
post:
description: |-
@@ -5709,6 +5844,52 @@ paths:
summary: 启用/禁用企业
tags:
- 企业客户管理
/api/admin/iot-cards/by-iccid/{iccid}:
get:
parameters:
- description: ICCID
in: path
name: iccid
required: true
schema:
description: ICCID
type: string
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/DtoIotCardDetailResponse'
description: OK
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 请求参数错误
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 未认证或认证已过期
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 无权访问
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 服务器内部错误
security:
- BearerAuth: []
summary: 通过ICCID查询单卡详情
tags:
- IoT卡管理
/api/admin/iot-cards/import:
post:
description: |-