mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-07 16:16:37 +08:00
feat(zone): add zone management api and legacy importer
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// Copyright 2026 Arctel.net
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Rain-kl/Wavelet/internal/apps/openflare/zone"
|
||||
"github.com/Rain-kl/Wavelet/internal/db/migrator"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var migrateZonesCmd = &cobra.Command{
|
||||
Use: "migrate-zones", Short: "导入旧域名数据到 Zone",
|
||||
PreRun: func(_ *cobra.Command, _ []string) { migrator.Migrate() },
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
report, err := zone.ImportLegacy(context.Background())
|
||||
return report.LogAndReturn(err)
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user