优化结构

This commit is contained in:
Yvan
2026-08-20 23:02:06 +08:00
parent 63dbb4cfbc
commit e65cf0b1d0
338 changed files with 622 additions and 481 deletions
-24
View File
@@ -1,24 +0,0 @@
package system
import (
"context"
"testing"
)
func TestVersionRepositoryPreservesNullableFields(t *testing.T) {
data := newTransactionTestData(t)
ctx := context.Background()
if err := data.gormDB.WithContext(ctx).Exec(
"INSERT INTO sys_versions (created_at, updated_at, version_name, version_code, description, version_data) VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, NULL, NULL)",
).Error; err != nil {
t.Fatal(err)
}
value, err := (&versionRepo{data: data}).FindVersion(ctx, 1)
if err != nil {
t.Fatal(err)
}
if value.Name != nil || value.Code != nil || value.Description != nil || value.Data != nil {
t.Fatalf("nullable version fields = %#v/%#v/%#v/%#v, want nil", value.Name, value.Code, value.Description, value.Data)
}
}