refactor platform account and access models

This commit is contained in:
david
2026-07-28 13:35:59 +08:00
parent f808f1c51f
commit bc39021c0d
20 changed files with 234 additions and 181 deletions

View File

@@ -0,0 +1,23 @@
package models
import "testing"
func TestPlatformModelTableNames(t *testing.T) {
tests := []struct {
name string
table interface{ TableName() string }
want string
}{
{name: "account", table: &PlatformAccount{}, want: "platform_account"},
{name: "menu", table: &PlatformMenu{}, want: "platform_menu"},
{name: "role", table: &PlatformRole{}, want: "platform_role"},
{name: "role menu", table: &PlatformRoleMenu{}, want: "platform_role_menu"},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
if got := test.table.TableName(); got != test.want {
t.Fatalf("TableName() = %q, want %q", got, test.want)
}
})
}
}