fix: 修复分页字段/角色DTO/套餐详情/批量分配Bug,新增C端测试登录接口和Hurl价格验证测试
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
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:
@@ -155,6 +155,28 @@ func (s *Service) Get(ctx context.Context, id uint) (*dto.PackageResponse, error
|
||||
series, err := s.packageSeriesStore.GetByID(ctx, pkg.SeriesID)
|
||||
if err == nil {
|
||||
resp.SeriesName = &series.SeriesName
|
||||
|
||||
// 代理用户:增强佣金信息(与 List 接口保持一致)
|
||||
userType := middleware.GetUserTypeFromContext(ctx)
|
||||
shopID := middleware.GetShopIDFromContext(ctx)
|
||||
if userType == constants.UserTypeAgent && shopID > 0 && series.EnableOneTimeCommission {
|
||||
config, _ := series.GetOneTimeCommissionConfig()
|
||||
if config != nil && config.Enable {
|
||||
allocations, saErr := s.shopSeriesAllocationStore.GetByShopID(ctx, shopID)
|
||||
if saErr == nil {
|
||||
seriesAllocationMap := make(map[uint]*model.ShopSeriesAllocation)
|
||||
seriesConfigMap := make(map[uint]*model.OneTimeCommissionConfig)
|
||||
for _, alloc := range allocations {
|
||||
if alloc.SeriesID == pkg.SeriesID {
|
||||
seriesAllocationMap[alloc.SeriesID] = alloc
|
||||
break
|
||||
}
|
||||
}
|
||||
seriesConfigMap[pkg.SeriesID] = config
|
||||
s.fillCommissionInfo(resp, pkg.SeriesID, seriesAllocationMap, seriesConfigMap)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return resp, nil
|
||||
|
||||
Reference in New Issue
Block a user