修复套餐快照集成测试与自动购包幂等

This commit is contained in:
2026-07-23 12:23:52 +09:00
parent 2df44d8e3c
commit 992757c056
8 changed files with 33 additions and 23 deletions

View File

@@ -21,6 +21,7 @@ func NewShopPackageBatchAllocationHandler(service *batchAllocationService.Servic
}
// BatchAllocate 批量分配套餐
// POST /api/admin/shop-package-allocations/batch
func (h *ShopPackageBatchAllocationHandler) BatchAllocate(c *fiber.Ctx) error {
var req dto.BatchAllocatePackagesRequest
if err := c.BodyParser(&req); err != nil {

View File

@@ -1,8 +1,5 @@
package admin
// testIDMask 用于将纳秒时间戳截断为合法的 uint 主键范围,仅限测试用。
const testIDMask = 0x7fffffff
import (
"bytes"
"context"
@@ -27,6 +24,9 @@ import (
"gorm.io/gorm"
)
// testIDMask 用于将纳秒时间戳截断为合法的 uint 主键范围,仅限测试用。
const testIDMask = 0x7fffffff
// TestBatchAllocatePackagesHTTPRequiresExplicitExpiryBase 验证批量分配显式选择并固化到全部记录。
func TestBatchAllocatePackagesHTTPRequiresExplicitExpiryBase(t *testing.T) {
testCases := []struct {