feat: 实现运营商模块重构,添加冗余字段优化查询性能
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 5m16s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 5m16s
主要变更: - 新增 Carrier CRUD API(创建、列表、详情、更新、删除、状态更新) - IotCard/IotCardImportTask 添加 carrier_type/carrier_name 冗余字段 - 移除 Carrier 表的 channel_name/channel_code 字段 - 查询时直接使用冗余字段,避免 JOIN Carrier 表 - 添加数据库迁移脚本(000021-000023) - 添加单元测试和集成测试 - 同步更新 OpenAPI 文档和 specs
This commit is contained in:
@@ -550,6 +550,55 @@ components:
|
||||
description: 提示信息
|
||||
type: string
|
||||
type: object
|
||||
DtoCarrierPageResult:
|
||||
properties:
|
||||
list:
|
||||
description: 运营商列表
|
||||
items:
|
||||
$ref: '#/components/schemas/DtoCarrierResponse'
|
||||
nullable: true
|
||||
type: array
|
||||
page:
|
||||
description: 当前页
|
||||
type: integer
|
||||
page_size:
|
||||
description: 每页数量
|
||||
type: integer
|
||||
total:
|
||||
description: 总数
|
||||
type: integer
|
||||
total_pages:
|
||||
description: 总页数
|
||||
type: integer
|
||||
type: object
|
||||
DtoCarrierResponse:
|
||||
properties:
|
||||
carrier_code:
|
||||
description: 运营商编码
|
||||
type: string
|
||||
carrier_name:
|
||||
description: 运营商名称
|
||||
type: string
|
||||
carrier_type:
|
||||
description: 运营商类型 (CMCC:中国移动, CUCC:中国联通, CTCC:中国电信, CBN:中国广电)
|
||||
type: string
|
||||
created_at:
|
||||
description: 创建时间
|
||||
type: string
|
||||
description:
|
||||
description: 运营商描述
|
||||
type: string
|
||||
id:
|
||||
description: 运营商ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
status:
|
||||
description: 状态 (1:启用, 0:禁用)
|
||||
type: integer
|
||||
updated_at:
|
||||
description: 更新时间
|
||||
type: string
|
||||
type: object
|
||||
DtoChangePasswordRequest:
|
||||
properties:
|
||||
new_password:
|
||||
@@ -595,6 +644,30 @@ components:
|
||||
- password
|
||||
- user_type
|
||||
type: object
|
||||
DtoCreateCarrierRequest:
|
||||
properties:
|
||||
carrier_code:
|
||||
description: 运营商编码
|
||||
maxLength: 50
|
||||
minLength: 1
|
||||
type: string
|
||||
carrier_name:
|
||||
description: 运营商名称
|
||||
maxLength: 100
|
||||
minLength: 1
|
||||
type: string
|
||||
carrier_type:
|
||||
description: 运营商类型 (CMCC:中国移动, CUCC:中国联通, CTCC:中国电信, CBN:中国广电)
|
||||
type: string
|
||||
description:
|
||||
description: 运营商描述
|
||||
maxLength: 500
|
||||
type: string
|
||||
required:
|
||||
- carrier_code
|
||||
- carrier_name
|
||||
- carrier_type
|
||||
type: object
|
||||
DtoCreateCustomerAccountReq:
|
||||
properties:
|
||||
password:
|
||||
@@ -1473,6 +1546,9 @@ components:
|
||||
carrier_name:
|
||||
description: 运营商名称
|
||||
type: string
|
||||
carrier_type:
|
||||
description: 运营商类型 (CMCC:中国移动, CUCC:中国联通, CTCC:中国电信, CBN:中国广电)
|
||||
type: string
|
||||
completed_at:
|
||||
description: 完成时间
|
||||
format: date-time
|
||||
@@ -1543,6 +1619,9 @@ components:
|
||||
carrier_name:
|
||||
description: 运营商名称
|
||||
type: string
|
||||
carrier_type:
|
||||
description: 运营商类型 (CMCC:中国移动, CUCC:中国联通, CTCC:中国电信, CBN:中国广电)
|
||||
type: string
|
||||
completed_at:
|
||||
description: 完成时间
|
||||
format: date-time
|
||||
@@ -1615,6 +1694,9 @@ components:
|
||||
carrier_name:
|
||||
description: 运营商名称
|
||||
type: string
|
||||
carrier_type:
|
||||
description: 运营商类型 (CMCC:中国移动, CUCC:中国联通, CTCC:中国电信, CBN:中国广电)
|
||||
type: string
|
||||
cost_price:
|
||||
description: 成本价(分)
|
||||
type: integer
|
||||
@@ -2563,6 +2645,9 @@ components:
|
||||
carrier_name:
|
||||
description: 运营商名称
|
||||
type: string
|
||||
carrier_type:
|
||||
description: 运营商类型 (CMCC:中国移动, CUCC:中国联通, CTCC:中国电信, CBN:中国广电)
|
||||
type: string
|
||||
cost_price:
|
||||
description: 成本价(分)
|
||||
type: integer
|
||||
@@ -2653,6 +2738,28 @@ components:
|
||||
description: 备注(最多500字)
|
||||
type: string
|
||||
type: object
|
||||
DtoUpdateCarrierParams:
|
||||
properties:
|
||||
carrier_name:
|
||||
description: 运营商名称
|
||||
maxLength: 100
|
||||
minLength: 1
|
||||
nullable: true
|
||||
type: string
|
||||
description:
|
||||
description: 运营商描述
|
||||
maxLength: 500
|
||||
nullable: true
|
||||
type: string
|
||||
type: object
|
||||
DtoUpdateCarrierStatusParams:
|
||||
properties:
|
||||
status:
|
||||
description: 状态 (1:启用, 0:禁用)
|
||||
type: integer
|
||||
required:
|
||||
- status
|
||||
type: object
|
||||
DtoUpdateCustomerAccountPasswordReq:
|
||||
properties:
|
||||
password:
|
||||
@@ -3975,6 +4082,308 @@ paths:
|
||||
summary: 修改授权备注
|
||||
tags:
|
||||
- 授权记录管理
|
||||
/api/admin/carriers:
|
||||
get:
|
||||
parameters:
|
||||
- description: 页码
|
||||
in: query
|
||||
name: page
|
||||
schema:
|
||||
description: 页码
|
||||
minimum: 1
|
||||
type: integer
|
||||
- description: 每页数量
|
||||
in: query
|
||||
name: page_size
|
||||
schema:
|
||||
description: 每页数量
|
||||
maximum: 100
|
||||
minimum: 1
|
||||
type: integer
|
||||
- description: 运营商类型 (CMCC:中国移动, CUCC:中国联通, CTCC:中国电信, CBN:中国广电)
|
||||
in: query
|
||||
name: carrier_type
|
||||
schema:
|
||||
description: 运营商类型 (CMCC:中国移动, CUCC:中国联通, CTCC:中国电信, CBN:中国广电)
|
||||
nullable: true
|
||||
type: string
|
||||
- description: 运营商名称(模糊搜索)
|
||||
in: query
|
||||
name: carrier_name
|
||||
schema:
|
||||
description: 运营商名称(模糊搜索)
|
||||
maxLength: 100
|
||||
nullable: true
|
||||
type: string
|
||||
- description: 状态 (1:启用, 0:禁用)
|
||||
in: query
|
||||
name: status
|
||||
schema:
|
||||
description: 状态 (1:启用, 0:禁用)
|
||||
nullable: true
|
||||
type: integer
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoCarrierPageResult'
|
||||
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:
|
||||
- 运营商管理
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoCreateCarrierRequest'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoCarrierResponse'
|
||||
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/carriers/{id}:
|
||||
delete:
|
||||
parameters:
|
||||
- description: ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
description: ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
responses:
|
||||
"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:
|
||||
- 运营商管理
|
||||
get:
|
||||
parameters:
|
||||
- description: ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
description: ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoCarrierResponse'
|
||||
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:
|
||||
- 运营商管理
|
||||
put:
|
||||
parameters:
|
||||
- description: ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
description: ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoUpdateCarrierParams'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoCarrierResponse'
|
||||
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/carriers/{id}/status:
|
||||
put:
|
||||
parameters:
|
||||
- description: ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
description: ID
|
||||
minimum: 0
|
||||
type: integer
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DtoUpdateCarrierStatusParams'
|
||||
responses:
|
||||
"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/commission/withdrawal-requests:
|
||||
get:
|
||||
parameters:
|
||||
|
||||
Reference in New Issue
Block a user