feat: 实现设备管理和设备导入功能,修复测试问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 5m30s

主要变更:
- 实现设备管理模块(创建、查询、列表、更新状态、删除)
- 实现设备批量导入功能(CSV 解析、ICCID 绑定、异步任务处理)
- 添加设备-SIM 卡绑定约束(部分唯一索引防止并发问题)
- 修复 fee_rate 数据库字段类型(numeric -> bigint)
- 修复测试数据隔离问题(基于增量断言)
- 修复集成测试中间件顺序问题
- 清理无用测试文件(PersonalCustomer、Email 相关)
- 归档 enterprise-card-authorization 变更
This commit is contained in:
2026-01-26 18:05:12 +08:00
parent fdcff33058
commit ce0783f96e
68 changed files with 6400 additions and 1482 deletions

View File

@@ -37,7 +37,7 @@ import (
// roleTestEnv 角色测试环境
type roleTestEnv struct {
tx *gorm.DB
rdb *redis.Client
rdb *redis.Client
app *fiber.App
roleService *roleService.Service
postgresCleanup func()
@@ -121,12 +121,15 @@ func setupRoleTestEnv(t *testing.T) *roleTestEnv {
services := &bootstrap.Handlers{
Role: roleHandler,
}
middlewares := &bootstrap.Middlewares{}
middlewares := &bootstrap.Middlewares{
AdminAuth: func(c *fiber.Ctx) error { return c.Next() },
H5Auth: func(c *fiber.Ctx) error { return c.Next() },
}
routes.RegisterRoutes(app, services, middlewares)
return &roleTestEnv{
tx: tx,
rdb: rdb,
rdb: rdb,
app: app,
roleService: roleSvc,
postgresCleanup: func() {