企业授权增强与资产列表扩展
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m9s

- 企业卡授权唯一约束:新增 DB 迁移(000154),卡级部分唯一索引防止同一张卡被多个企业同时持有,Service 层新增跨企业冲突检测
- 单卡列表新增 network_status 过滤参数
- 单卡/设备列表新增 asset_status、asset_status_name、generation 响应字段
- 单卡/设备列表新增企业维度过滤(authorized_enterprise_id、is_authorized_to_enterprise)及响应中企业授权信息(批量加载,无 N+1)
- 主钱包流水/退款列表新增 asset_identifier 精确过滤参数
- 企业卡授权/收回接口升级为三模式(list/range/filter),企业设备授权/收回升级为双模式(list/filter)
- 升级 sonic v1.14.2 → v1.15.2 以兼容 Go 1.26

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-17 16:23:03 +09:00
parent cf36f1447f
commit 3b7b856e48
37 changed files with 1260 additions and 84 deletions

View File

@@ -523,17 +523,54 @@ components:
type: object
DtoAllocateCardsReq:
properties:
batch_no:
description: '[filter模式] 批次号'
maxLength: 100
type: string
carrier_id:
description: '[filter模式] 运营商ID'
minimum: 0
nullable: true
type: integer
iccid:
description: '[filter模式] ICCID模糊匹配'
maxLength: 20
type: string
iccid_end:
description: '[range模式] 号段结束ICCID'
maxLength: 20
type: string
iccid_start:
description: '[range模式] 号段起始ICCID'
maxLength: 20
type: string
iccids:
description: 需要授权的 ICCID 列表
description: '[list模式] ICCID列表最多1000个'
items:
type: string
nullable: true
type: array
remark:
description: 授权备注
description: 授权备注(所有模式均可选)
maxLength: 500
type: string
selection_type:
description: 选取模式 (list:指定ICCID列表, range:号段范围, filter:按条件过滤)
type: string
shop_id:
description: '[filter模式] 店铺ID'
minimum: 0
nullable: true
type: integer
shop_ids:
description: '[filter模式] 店铺ID列表'
items:
minimum: 0
type: integer
nullable: true
type: array
required:
- iccids
- selection_type
type: object
DtoAllocateCardsResp:
properties:
@@ -552,15 +589,34 @@ components:
type: object
DtoAllocateDevicesReq:
properties:
batch_no:
description: '[filter模式] 批次号'
maxLength: 100
type: string
device_nos:
description: 设备号列表最多100个
description: '[list模式] 设备号列表最多100个'
items:
type: string
nullable: true
type: array
remark:
description: 授权备注
description: 授权备注(所有模式均可选)
maxLength: 500
type: string
selection_type:
description: 选取模式 (list:指定设备号列表, filter:按条件过滤)
type: string
shop_id:
description: '[filter模式] 店铺ID'
minimum: 0
nullable: true
type: integer
virtual_no:
description: '[filter模式] 设备虚拟号(模糊匹配)'
maxLength: 100
type: string
required:
- selection_type
type: object
DtoAllocateDevicesRequest:
properties:
@@ -3262,7 +3318,7 @@ components:
description: 导出筛选参数(JSON对象可选)
type: object
scene:
description: 导出场景 (device:设备, iot_card:IoT卡)
description: 导出场景 (device:设备, iot_card:IoT卡, order:订单)
type: string
required:
- scene
@@ -4617,6 +4673,20 @@ components:
activation_status_name:
description: 激活状态名称(中文)
type: string
asset_status:
description: 业务状态 (1:在库, 2:已销售, 3:已换货, 4:已停用)
type: integer
asset_status_name:
description: 业务状态名称(中文)
type: string
authorized_enterprise_id:
description: 当前有效授权的企业ID未授权时为 null
minimum: 0
nullable: true
type: integer
authorized_enterprise_name:
description: 当前有效授权的企业名称,未授权时为空字符串
type: string
batch_no:
description: 批次号
type: string
@@ -4636,6 +4706,9 @@ components:
device_type:
description: 设备类型
type: string
generation:
description: 资产世代编号初始值1每次换货转新后+1
type: integer
id:
description: 设备ID
minimum: 0
@@ -5180,7 +5253,7 @@ components:
description: 任务进度(0-100)
type: integer
scene:
description: 导出场景 (device:设备, iot_card:IoT卡)
description: 导出场景 (device:设备, iot_card:IoT卡, order:订单)
type: string
started_at:
description: 开始处理时间
@@ -5260,7 +5333,7 @@ components:
description: 任务进度(0-100)
type: integer
scene:
description: 导出场景 (device:设备, iot_card:IoT卡)
description: 导出场景 (device:设备, iot_card:IoT卡, order:订单)
type: string
started_at:
description: 开始处理时间
@@ -6980,14 +7053,38 @@ components:
type: object
DtoRecallCardsReq:
properties:
batch_no:
description: '[filter模式] 批次号'
maxLength: 100
type: string
carrier_id:
description: '[filter模式] 运营商ID'
minimum: 0
nullable: true
type: integer
iccid:
description: '[filter模式] ICCID模糊匹配'
maxLength: 20
type: string
iccid_end:
description: '[range模式] 号段结束ICCID'
maxLength: 20
type: string
iccid_start:
description: '[range模式] 号段起始ICCID'
maxLength: 20
type: string
iccids:
description: 需要回收授权的 ICCID 列表
description: '[list模式] 需要回收授权的ICCID列表'
items:
type: string
nullable: true
type: array
selection_type:
description: 选取模式 (list:指定ICCID列表, range:号段范围, filter:按条件过滤)
type: string
required:
- iccids
- selection_type
type: object
DtoRecallCardsResp:
properties:
@@ -7012,12 +7109,25 @@ components:
type: object
DtoRecallDevicesReq:
properties:
batch_no:
description: '[filter模式] 批次号'
maxLength: 100
type: string
device_nos:
description: 设备号列表最多100个
description: '[list模式] 设备号列表最多100个'
items:
type: string
nullable: true
type: array
selection_type:
description: 选取模式 (list:指定设备号列表, filter:按条件过滤)
type: string
virtual_no:
description: '[filter模式] 设备虚拟号(模糊匹配)'
maxLength: 100
type: string
required:
- selection_type
type: object
DtoRecallDevicesRequest:
properties:
@@ -7999,6 +8109,20 @@ components:
activation_status_name:
description: 激活状态名称(中文)
type: string
asset_status:
description: 业务状态 (1:在库, 2:已销售, 3:已换货, 4:已停用)
type: integer
asset_status_name:
description: 业务状态名称(中文)
type: string
authorized_enterprise_id:
description: 当前有效授权的企业ID未授权时为 null
minimum: 0
nullable: true
type: integer
authorized_enterprise_name:
description: 当前有效授权的企业名称,未授权时为空字符串
type: string
batch_no:
description: 批次号
type: string
@@ -8042,6 +8166,9 @@ components:
gateway_extend:
description: Gateway 卡状态扩展字段,原样返回上游 extend用于展示运营商侧实际停机原因
type: string
generation:
description: 资产世代编号初始值1每次换货转新后+1
type: integer
iccid:
description: ICCID
type: string
@@ -13689,6 +13816,21 @@ paths:
description: 关键字搜索匹配虚拟号或IMEI(模糊查询与virtual_no/imei独立)
maxLength: 100
type: string
- description: 按有效授权企业ID过滤只返回当前授权给该企业的设备
in: query
name: authorized_enterprise_id
schema:
description: 按有效授权企业ID过滤只返回当前授权给该企业的设备
minimum: 0
nullable: true
type: integer
- description: 企业授权状态过滤 (true:已授权给某企业, false:未授权任何企业)
in: query
name: is_authorized_to_enterprise
schema:
description: 企业授权状态过滤 (true:已授权给某企业, false:未授权任何企业)
nullable: true
type: boolean
responses:
"200":
content:
@@ -16225,11 +16367,11 @@ paths:
maximum: 100
minimum: 1
type: integer
- description: 导出场景 (device:设备, iot_card:IoT卡)
- description: 导出场景 (device:设备, iot_card:IoT卡, order:订单)
in: query
name: scene
schema:
description: 导出场景 (device:设备, iot_card:IoT卡)
description: 导出场景 (device:设备, iot_card:IoT卡, order:订单)
type: string
- description: 任务状态 (1:待处理, 2:处理中, 3:已完成, 4:已失败, 5:已取消)
in: query
@@ -16313,7 +16455,7 @@ paths:
tags:
- 导出任务
post:
description: 创建统一导出任务,支持场景 scene=device/iot_card 和格式 format=xlsx/csv。
description: 创建统一导出任务,支持场景 scene=device/iot_card/order 和格式 format=xlsx/csv。
requestBody:
content:
application/json:
@@ -17078,6 +17220,30 @@ paths:
description: 关键字搜索匹配ICCID或卡虚拟号(模糊查询与iccid/virtual_no独立)
maxLength: 100
type: string
- description: 网络状态 (0:停机, 1:开机)
in: query
name: network_status
schema:
description: 网络状态 (0:停机, 1:开机)
maximum: 1
minimum: 0
nullable: true
type: integer
- description: 按有效授权企业ID过滤只返回当前授权给该企业的卡
in: query
name: authorized_enterprise_id
schema:
description: 按有效授权企业ID过滤只返回当前授权给该企业的卡
minimum: 0
nullable: true
type: integer
- description: 企业授权状态过滤 (true:已授权给某企业, false:未授权任何企业)
in: query
name: is_authorized_to_enterprise
schema:
description: 企业授权状态过滤 (true:已授权给某企业, false:未授权任何企业)
nullable: true
type: boolean
responses:
"200":
content:
@@ -20655,6 +20821,13 @@ paths:
minimum: 0
nullable: true
type: integer
- description: 资产标识精确检索ICCID 或 设备虚拟号,非空时精确匹配)
in: query
name: asset_identifier
schema:
description: 资产标识精确检索ICCID 或 设备虚拟号,非空时精确匹配)
maxLength: 100
type: string
responses:
"200":
content:
@@ -22740,6 +22913,13 @@ paths:
schema:
description: 结束日期YYYY-MM-DD
type: string
- description: 资产标识精确检索ICCID 或 设备虚拟号,非空时精确匹配)
in: query
name: asset_identifier
schema:
description: 资产标识精确检索ICCID 或 设备虚拟号,非空时精确匹配)
maxLength: 100
type: string
- description: 店铺ID
in: path
name: shop_id