优化结构

This commit is contained in:
Yvan
2026-08-22 12:13:16 +08:00
parent d987244d0e
commit b27a66e9d3
200 changed files with 1794 additions and 1715 deletions
+5 -6
View File
@@ -2,22 +2,21 @@ package service
import (
"context"
"kra/internal/biz/system"
"testing"
"kra/internal/biz"
)
type dictionaryExportRepo struct {
biz.DictionaryRepo
value *biz.Dictionary
system.DictionaryRepo
value *system.Dictionary
}
func (r dictionaryExportRepo) ExportDictionary(context.Context, uint) (*biz.Dictionary, error) {
func (r dictionaryExportRepo) ExportDictionary(context.Context, uint) (*system.Dictionary, error) {
return r.value, nil
}
func TestExportDictionaryPreservesNilDetails(t *testing.T) {
service := NewDictionaryService(biz.NewDictionaryUsecase(dictionaryExportRepo{value: &biz.Dictionary{Name: "empty", Type: "empty"}}))
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)