修复飘红问题
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Failing after 15h48m25s

This commit is contained in:
2026-02-02 17:52:14 +08:00
parent 301eb6158e
commit 0b82f30f86
4 changed files with 38 additions and 21 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/break/junhong_cmp_fiber/internal/model"
"github.com/break/junhong_cmp_fiber/internal/service/account"
"github.com/break/junhong_cmp_fiber/internal/service/account_audit"
"github.com/break/junhong_cmp_fiber/internal/store/postgres"
"github.com/break/junhong_cmp_fiber/pkg/constants"
"github.com/break/junhong_cmp_fiber/pkg/middleware"
@@ -24,7 +25,11 @@ func TestRoleAssignmentLimit_PlatformUser(t *testing.T) {
accountStore := postgres.NewAccountStore(tx, rdb)
roleStore := postgres.NewRoleStore(tx)
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
service := account.New(accountStore, roleStore, accountRoleStore)
shopStore := postgres.NewShopStore(tx, rdb)
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
auditLogStore := postgres.NewAccountOperationLogStore(tx)
auditService := account_audit.NewService(auditLogStore)
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
ctx := context.Background()
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))
@@ -65,7 +70,11 @@ func TestRoleAssignmentLimit_AgentUser(t *testing.T) {
accountStore := postgres.NewAccountStore(tx, rdb)
roleStore := postgres.NewRoleStore(tx)
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
service := account.New(accountStore, roleStore, accountRoleStore)
shopStore := postgres.NewShopStore(tx, rdb)
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
auditLogStore := postgres.NewAccountOperationLogStore(tx)
auditService := account_audit.NewService(auditLogStore)
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
ctx := context.Background()
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))
@@ -109,7 +118,11 @@ func TestRoleAssignmentLimit_EnterpriseUser(t *testing.T) {
accountStore := postgres.NewAccountStore(tx, rdb)
roleStore := postgres.NewRoleStore(tx)
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
service := account.New(accountStore, roleStore, accountRoleStore)
shopStore := postgres.NewShopStore(tx, rdb)
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
auditLogStore := postgres.NewAccountOperationLogStore(tx)
auditService := account_audit.NewService(auditLogStore)
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
ctx := context.Background()
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))
@@ -153,7 +166,11 @@ func TestRoleAssignmentLimit_SuperAdmin(t *testing.T) {
accountStore := postgres.NewAccountStore(tx, rdb)
roleStore := postgres.NewRoleStore(tx)
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
service := account.New(accountStore, roleStore, accountRoleStore)
shopStore := postgres.NewShopStore(tx, rdb)
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
auditLogStore := postgres.NewAccountOperationLogStore(tx)
auditService := account_audit.NewService(auditLogStore)
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
ctx := context.Background()
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))