This commit is contained in:
2026-08-15 02:35:23 +08:00
parent bd5dbf2522
commit a34133cce5
49 changed files with 929 additions and 504 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ func TestUserAuthorityWritesAreAtomic(t *testing.T) {
if err := data.gormDB.WithContext(ctx).Create(&[]authorityPO{{AuthorityID: 888, AuthorityName: "admin"}, {AuthorityID: 999, AuthorityName: "operator"}}).Error; err != nil {
t.Fatal(err)
}
repo := &systemRepo{data: data}
repo := &userRepo{data: data}
user := &biz.User{Username: "atomic", Password: "hash", NickName: "before", AuthorityID: 888, Enable: 1}
created, err := repo.CreateUserWithAuthorities(ctx, user, []uint{888, 999})
if err != nil {
@@ -66,7 +66,7 @@ func TestUserAuthorityWritesAreAtomic(t *testing.T) {
func TestDictionaryImportKeepsHierarchyInOneTransaction(t *testing.T) {
data := newTransactionTestData(t)
ctx := context.Background()
repo := &settingsRepo{data: data}
repo := &dictionaryRepo{data: data}
parentID := uint(10)
dictionary := &biz.Dictionary{Name: "status", Type: "status", Status: true}
details := []*biz.DictionaryDetail{{ID: 10, Label: "parent", Value: "1", Status: true}, {ID: 11, Label: "child", Value: "2", ParentID: &parentID, Status: true}}