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

@@ -7,6 +7,7 @@ import (
apphandler "github.com/break/junhong_cmp_fiber/internal/handler/app"
"github.com/break/junhong_cmp_fiber/internal/middleware"
"github.com/break/junhong_cmp_fiber/internal/model/dto"
"github.com/break/junhong_cmp_fiber/pkg/config"
"github.com/break/junhong_cmp_fiber/pkg/openapi"
)
@@ -53,6 +54,18 @@ func RegisterPersonalCustomerRoutes(router fiber.Router, doc *openapi.Generator,
Output: &dto.ClientSendCodeResponse{},
})
// 开发模式测试登录接口(仅 logging.development=true 时注册)
if config.Get().Logging.Development {
Register(router, doc, basePath, "POST", authBasePath+"/dev-login", handlers.ClientAuth.DevLogin, RouteSpec{
Summary: "开发环境测试登录",
Description: "⚠️ 仅开发模式可用。传入资产标识符ICCID等自动绑定测试客户并签发 JWT用于接口测试。",
Tags: []string{"个人客户 - 认证"},
Auth: false,
Input: &dto.DevLoginRequest{},
Output: &dto.DevLoginResponse{},
})
}
// === 需要认证的 auth 路由 ===
authProtectedGroup := router.Group(authBasePath)
authProtectedGroup.Use(personalAuthMiddleware.Authenticate())