优化结构

This commit is contained in:
Yvan
2026-08-23 02:36:58 +08:00
parent 7d89e2ea4d
commit 40632c5756
50 changed files with 408 additions and 115 deletions
@@ -0,0 +1,27 @@
package system
import (
"context"
"kra/internal/biz/system"
"testing"
)
type dictionaryExportRepo struct {
system.DictionaryRepo
value *system.Dictionary
}
func (r dictionaryExportRepo) ExportDictionary(context.Context, uint) (*system.Dictionary, error) {
return r.value, nil
}
func TestExportDictionaryPreservesNilDetails(t *testing.T) {
service := NewDictionaryService(system.NewDictionaryUsecase(dictionaryExportRepo{value: &system.Dictionary{Name: "empty", Type: "empty"}}))
result, err := service.ExportDictionary(context.Background(), 1)
if err != nil {
t.Fatal(err)
}
if result.SysDictionaryDetails != nil {
t.Fatalf("export details = %#v, want nil", result.SysDictionaryDetails)
}
}