优化结构
This commit is contained in:
@@ -2,10 +2,10 @@ package system
|
||||
|
||||
import (
|
||||
"context"
|
||||
"kra/internal/biz/system"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"kra/internal/biz"
|
||||
"kra/internal/conf"
|
||||
)
|
||||
|
||||
@@ -31,7 +31,7 @@ func TestMenuCreatePreservesSubmittedTimestamps(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
createdAt := time.Date(2025, time.January, 2, 3, 4, 5, 0, time.UTC)
|
||||
updatedAt := time.Date(2025, time.February, 3, 4, 5, 6, 0, time.UTC)
|
||||
menu := &biz.Menu{CreatedAt: createdAt, UpdatedAt: updatedAt, Name: "created", Path: "created", Component: "view/created.vue", Title: "Created"}
|
||||
menu := &system.Menu{CreatedAt: createdAt, UpdatedAt: updatedAt, Name: "created", Path: "created", Component: "view/created.vue", Title: "Created"}
|
||||
|
||||
if err := (&menuRepo{data: data}).Create(ctx, menu); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -90,16 +90,16 @@ func TestMenuUpdateRebuildsRelationsWithoutChangingRequestedIdentity(t *testing.
|
||||
}
|
||||
|
||||
repo := &menuRepo{data: data}
|
||||
err := repo.Update(ctx, &biz.Menu{
|
||||
err := repo.Update(ctx, &system.Menu{
|
||||
ID: 10,
|
||||
Name: "after",
|
||||
Path: "after",
|
||||
Component: "view/after.vue",
|
||||
Title: "After",
|
||||
Parameters: []*biz.MenuParameter{{
|
||||
Parameters: []*system.MenuParameter{{
|
||||
ID: 21, CreatedAt: createdAt, UpdatedAt: updatedAt, Type: "params", Key: "new", Value: "value",
|
||||
}},
|
||||
Buttons: []*biz.MenuButton{{
|
||||
Buttons: []*system.MenuButton{{
|
||||
ID: 31, CreatedAt: createdAt, UpdatedAt: updatedAt, Name: "edit", Description: "new",
|
||||
}},
|
||||
})
|
||||
@@ -163,7 +163,7 @@ func TestSetMenuRolesStrictOnlyChangesManagedAuthorities(t *testing.T) {
|
||||
}).Error; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ctx := biz.NewActorContext(context.Background(), biz.Actor{AuthorityID: actorID})
|
||||
ctx := system.NewActorContext(context.Background(), system.Actor{AuthorityID: actorID})
|
||||
repo := &menuRepo{data: data}
|
||||
if err := repo.SetMenuRoles(ctx, menu.ID, []uint{siblingID}); err == nil {
|
||||
t.Fatal("SetMenuRoles() accepted an out-of-scope authority")
|
||||
|
||||
Reference in New Issue
Block a user