fix: 修复分页字段/角色DTO/套餐详情/批量分配Bug,新增C端测试登录接口和Hurl价格验证测试
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled

- 修复B-2:27个分页DTO字段名统一(list→items, page_size→size,删除total_pages)
- 修复B-1:角色接口统一返回DTO(id小写,消除GORM大写字段名)
- 修复C-1:套餐详情接口(GET /packages/:id)补充代理佣金字段
- 修复C-2:批量分配已存在记录由500改为静默跳过
- 修复C-3:创建系列授权响应在事务提交后构建,packages数组不再为空
- 新增C端开发测试登录接口(POST /api/c/v1/auth/dev-login,仅logging.development=true时生效)
- 新增Hurl测试:card-price-verification-flow.hurl(导入卡→分配→C端价格验证)
- 新增测试Excel数据文件和dev.env测试变量
This commit is contained in:
2026-03-31 09:54:08 +08:00
parent 33e7f99fdc
commit 2ef8b8a705
54 changed files with 1697 additions and 260 deletions

View File

@@ -51,6 +51,6 @@ type AgentRechargeListRequest struct {
type AgentRechargeListResponse struct {
Total int64 `json:"total" description:"总记录数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"page_size" description:"每页条数"`
List []*AgentRechargeResponse `json:"list" description:"充值记录列表"`
PageSize int `json:"size" description:"每页条数"`
List []*AgentRechargeResponse `json:"items" description:"充值记录列表"`
}

View File

@@ -14,5 +14,5 @@ type AllocationConfigResponse struct {
// AllocationConfigListResponse 配置版本列表响应
type AllocationConfigListResponse struct {
List []*AllocationConfigResponse `json:"list" description:"配置版本列表"`
List []*AllocationConfigResponse `json:"items" description:"配置版本列表"`
}

View File

@@ -22,9 +22,8 @@ type PriceHistoryListRequest struct {
// PriceHistoryPageResult 成本价历史分页结果
type PriceHistoryPageResult struct {
List []*PriceHistoryResponse `json:"list" description:"历史记录列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*PriceHistoryResponse `json:"items" description:"历史记录列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}

View File

@@ -43,11 +43,10 @@ type AssetAllocationRecordResponse struct {
// ListAssetAllocationRecordResponse 分配记录列表响应
type ListAssetAllocationRecordResponse struct {
List []*AssetAllocationRecordResponse `json:"list" description:"分配记录列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*AssetAllocationRecordResponse `json:"items" description:"分配记录列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"size" description:"每页数量"`
}
// GetAssetAllocationRecordRequest 获取分配记录详情请求

View File

@@ -44,9 +44,8 @@ type AssetWalletTransactionItem struct {
// AssetWalletTransactionListResponse 资产钱包流水列表响应
type AssetWalletTransactionListResponse struct {
List []*AssetWalletTransactionItem `json:"list" description:"流水列表"`
Total int64 `json:"total" description:"总记录数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*AssetWalletTransactionItem `json:"items" description:"流水列表"`
Total int64 `json:"total" description:"总记录数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"size" description:"每页数量"`
}

View File

@@ -55,9 +55,8 @@ type UpdateCarrierStatusParams struct {
}
type CarrierPageResult struct {
List []*CarrierResponse `json:"list" description:"运营商列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*CarrierResponse `json:"items" description:"运营商列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}

View File

@@ -161,10 +161,10 @@ type AssetPackageHistoryRequest struct {
// AssetPackageHistoryResponse B3 资产套餐历史响应
type AssetPackageHistoryResponse struct {
List []AssetPackageResponse `json:"list" description:"套餐历史列表"`
List []AssetPackageResponse `json:"items" description:"套餐历史列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"页码"`
PageSize int `json:"page_size" description:"每页数量"`
PageSize int `json:"size" description:"每页数量"`
}
// ========================================

View File

@@ -101,3 +101,20 @@ type ChangePhoneResponse struct {
type LogoutResponse struct {
Success bool `json:"success" description:"是否成功"`
}
// ========================================
// DevLogin 开发环境测试登录(仅开发模式可用)
// ========================================
// DevLoginRequest 开发环境测试登录请求
// ⚠️ 仅限 logging.development=true 时生效,严禁在生产环境暴露
type DevLoginRequest struct {
Identifier string `json:"identifier" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"资产标识符ICCID/虚拟号等)"`
}
// DevLoginResponse 开发环境测试登录响应
type DevLoginResponse struct {
Token string `json:"token" description:"JWT 令牌"`
CustomerID uint `json:"customer_id" description:"客户ID"`
IsNewUser bool `json:"is_new_user" description:"是否新创建的测试客户"`
}

View File

@@ -80,10 +80,10 @@ type ClientOrderListItem struct {
// ClientOrderListResponse D2 客户端订单列表响应
type ClientOrderListResponse struct {
List []ClientOrderListItem `json:"list" description:"订单列表"`
List []ClientOrderListItem `json:"items" description:"订单列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"页码"`
PageSize int `json:"page_size" description:"每页数量"`
PageSize int `json:"size" description:"每页数量"`
}
// ========================================

View File

@@ -45,10 +45,10 @@ type WalletTransactionItem struct {
// WalletTransactionListResponse C2 钱包流水列表响应
type WalletTransactionListResponse struct {
List []WalletTransactionItem `json:"list" description:"流水列表"`
List []WalletTransactionItem `json:"items" description:"流水列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"页码"`
PageSize int `json:"page_size" description:"每页数量"`
PageSize int `json:"size" description:"每页数量"`
}
// ========================================
@@ -131,8 +131,8 @@ type ClientRechargeListItem struct {
// ClientRechargeListResponse C5 充值记录列表响应
type ClientRechargeListResponse struct {
List []ClientRechargeListItem `json:"list" description:"充值记录列表"`
List []ClientRechargeListItem `json:"items" description:"充值记录列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"页码"`
PageSize int `json:"page_size" description:"每页数量"`
PageSize int `json:"size" description:"每页数量"`
}

View File

@@ -33,11 +33,10 @@ type CommissionRecordListRequest struct {
// CommissionRecordPageResult 佣金记录分页结果
type CommissionRecordPageResult struct {
List []*CommissionRecordResponse `json:"list" description:"佣金记录列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*CommissionRecordResponse `json:"items" description:"佣金记录列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}
// CommissionStatsResponse 佣金统计响应

View File

@@ -49,11 +49,10 @@ type DeviceResponse struct {
}
type ListDeviceResponse struct {
List []*DeviceResponse `json:"list" description:"设备列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*DeviceResponse `json:"items" description:"设备列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"size" description:"每页数量"`
}
type GetDeviceRequest struct {

View File

@@ -41,11 +41,10 @@ type DeviceImportTaskResponse struct {
}
type ListDeviceImportTaskResponse struct {
List []*DeviceImportTaskResponse `json:"list" description:"任务列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*DeviceImportTaskResponse `json:"items" description:"任务列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"size" description:"每页数量"`
}
type DeviceImportResultItemDTO struct {

View File

@@ -51,7 +51,7 @@ type H5EnterpriseDeviceListReq struct {
}
type EnterpriseDeviceListResp struct {
List []EnterpriseDeviceItem `json:"list" description:"设备列表"`
List []EnterpriseDeviceItem `json:"items" description:"设备列表"`
Total int64 `json:"total" description:"总数"`
}

View File

@@ -88,10 +88,10 @@ type ExchangeOrderResponse struct {
}
type ExchangeListResponse struct {
List []*ExchangeOrderResponse `json:"list" description:"换货单列表"`
List []*ExchangeOrderResponse `json:"items" description:"换货单列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"page_size" description:"每页数量"`
PageSize int `json:"size" description:"每页数量"`
}
type ClientExchangePendingResponse struct {

View File

@@ -55,11 +55,10 @@ type StandaloneIotCardResponse struct {
}
type ListStandaloneIotCardResponse struct {
List []*StandaloneIotCardResponse `json:"list" description:"单卡列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*StandaloneIotCardResponse `json:"items" description:"单卡列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"size" description:"每页数量"`
}
type ImportIotCardRequest struct {
@@ -105,11 +104,10 @@ type ImportTaskResponse struct {
}
type ListImportTaskResponse struct {
List []*ImportTaskResponse `json:"list" description:"任务列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*ImportTaskResponse `json:"items" description:"任务列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"size" description:"每页数量"`
}
type ImportResultItemDTO struct {

View File

@@ -26,11 +26,10 @@ type MyPackageResponse struct {
// MyPackagePageResult 我的可售套餐分页结果
type MyPackagePageResult struct {
List []*MyPackageResponse `json:"list" description:"套餐列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*MyPackageResponse `json:"items" description:"套餐列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}
// MyPackageDetailResponse 我的可售套餐详情响应
@@ -71,11 +70,10 @@ type MySeriesAllocationResponse struct {
// MySeriesAllocationPageResult 我的套餐系列分配分页结果
type MySeriesAllocationPageResult struct {
List []*MySeriesAllocationResponse `json:"list" description:"分配列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*MySeriesAllocationResponse `json:"items" description:"分配列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}
// PriceSource 价格来源常量

View File

@@ -82,11 +82,10 @@ type OrderResponse struct {
}
type OrderListResponse struct {
List []*OrderResponse `json:"list" description:"订单列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*OrderResponse `json:"items" description:"订单列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"size" description:"每页数量"`
}
type GetOrderRequest struct {

View File

@@ -124,11 +124,10 @@ type UpdateRetailPriceParams struct {
// PackagePageResult 套餐分页结果
type PackagePageResult struct {
List []*PackageResponse `json:"list" description:"套餐列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*PackageResponse `json:"items" description:"套餐列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}
// PackageUsageItemResponse 套餐使用项响应(客户视图)

View File

@@ -82,9 +82,8 @@ type UpdatePackageSeriesStatusParams struct {
// PackageSeriesPageResult 套餐系列分页结果
type PackageSeriesPageResult struct {
List []*PackageSeriesResponse `json:"list" description:"套餐系列列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*PackageSeriesResponse `json:"items" description:"套餐系列列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}

View File

@@ -69,11 +69,10 @@ type PollingAlertHistoryResp struct {
// PollingAlertHistoryListResp 告警历史列表响应
type PollingAlertHistoryListResp struct {
Items []*PollingAlertHistoryResp `json:"items" description:"告警历史列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
Items []*PollingAlertHistoryResp `json:"items" description:"告警历史列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}
// ListPollingAlertHistoryReq 查询告警历史请求

View File

@@ -59,11 +59,10 @@ type DataCleanupLogResp struct {
// DataCleanupLogListResp 数据清理日志列表响应
type DataCleanupLogListResp struct {
Items []*DataCleanupLogResp `json:"items" description:"日志列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
Items []*DataCleanupLogResp `json:"items" description:"日志列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}
// ListDataCleanupLogReq 查询数据清理日志请求

View File

@@ -73,9 +73,8 @@ type UpdatePollingConfigStatusParams struct {
// PollingConfigPageResult 轮询配置分页结果
type PollingConfigPageResult struct {
List []*PollingConfigResponse `json:"list" description:"配置列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*PollingConfigResponse `json:"items" description:"配置列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}

View File

@@ -51,11 +51,10 @@ type ManualTriggerLogResp struct {
// ManualTriggerLogListResp 手动触发日志列表响应
type ManualTriggerLogListResp struct {
Items []*ManualTriggerLogResp `json:"items" description:"日志列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
Items []*ManualTriggerLogResp `json:"items" description:"日志列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}
// ListManualTriggerLogReq 查询手动触发日志请求

View File

@@ -64,16 +64,10 @@ type RechargeListRequest struct {
// RechargeListResponse 充值订单列表响应
type RechargeListResponse struct {
// 列表数据
List []*RechargeResponse `json:"list" description:"列表数据"`
// 总记录数
Total int64 `json:"total" description:"总记录数"`
// 当前页码
Page int `json:"page" description:"当前页码"`
// 每页数量
PageSize int `json:"page_size" description:"每页数量"`
// 总页数
TotalPages int `json:"total_pages" description:"总页数"`
List []*RechargeResponse `json:"items" description:"列表数据"`
Total int64 `json:"total" description:"总记录数"`
Page int `json:"page" description:"当前页码"`
PageSize int `json:"size" description:"每页数量"`
}
// RechargeCheckRequest 充值预检请求

View File

@@ -103,11 +103,10 @@ type ShopSeriesGrantListItem struct {
// ShopSeriesGrantPageResult 系列授权分页结果
type ShopSeriesGrantPageResult struct {
List []*ShopSeriesGrantListItem `json:"list" description:"授权列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
TotalPages int `json:"total_pages" description:"总页数"`
List []*ShopSeriesGrantListItem `json:"items" description:"授权列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}
// UpdateShopSeriesGrantParams 更新系列授权聚合参数(文档生成用)

View File

@@ -123,10 +123,10 @@ type WechatConfigResponse struct {
// WechatConfigListResponse 微信参数配置列表响应
type WechatConfigListResponse struct {
List []*WechatConfigResponse `json:"list" description:"配置列表"`
List []*WechatConfigResponse `json:"items" description:"配置列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"page_size" description:"每页数量"`
PageSize int `json:"size" description:"每页数量"`
}
// MaskShortSecret 对短密钥进行脱敏处理