feat(api): add model delete, pagination, and cors config

This commit is contained in:
zenfun
2025-12-21 23:03:12 +08:00
parent 816ea93339
commit 73147fc55a
12 changed files with 304 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import "testing"
func TestLoad_LogDSNOverride(t *testing.T) {
t.Setenv("EZ_LOG_PG_DSN", "host=log-db user=postgres dbname=logs")
t.Setenv("EZ_LOG_PARTITIONING", "monthly")
t.Setenv("EZ_CORS_ALLOW_ORIGINS", "https://a.example.com,https://b.example.com")
cfg, err := Load()
if err != nil {
t.Fatalf("load config: %v", err)
@@ -15,4 +16,7 @@ func TestLoad_LogDSNOverride(t *testing.T) {
if cfg.Log.Partitioning != "monthly" {
t.Fatalf("expected log partitioning to be set, got %q", cfg.Log.Partitioning)
}
if len(cfg.CORS.AllowOrigins) != 2 {
t.Fatalf("expected cors allow origins, got %v", cfg.CORS.AllowOrigins)
}
}