Files
kontor/kontor-gin/internal/cmd/check.go
T
tpeetz bc88c694ee
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
add MediaLofi in kontor-gin (#97)
Co-authored-by: Thomas Peetz <thomas.peetz@cimt-ag.de>
Reviewed-on: #97
2026-10-09 16:26:11 +00:00

50 lines
1.2 KiB
Go

package cmd
import (
"kontor-api-gin/internal/api"
"kontor-api-gin/internal/config"
"log/slog"
"github.com/spf13/cobra"
"resty.dev/v3"
)
type Login struct {
Email string
Password string
}
type LoginResponse struct {
Token string
}
var checkCmd = &cobra.Command{
Use: "check",
Short: "Check Kontor Database",
Long: "Check Kontor Database to given file",
// Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
slog.Info("check kontor")
slog.Info("Verbosity level", "level", config.Verbose)
client := resty.New()
defer client.Close()
localServer := config.Config.Server["local"]
mainServer := config.Config.Server["main"]
localData, _ := api.GetData(localServer, config.Config.ApiVersion)
mainData, _ := api.GetData(mainServer, config.Config.ApiVersion)
slog.Info("comics local", "count", len(localData.Comic))
slog.Info("comics main", "count", len(mainData.Comic))
slog.Info("kontor.check_kontor.check_duplicate_links")
// check_duplicate_links(first_server, dirs)
slog.Info("kontor.check_kontor.check_media_dirs")
// check_media_dirs(first_server, dirs)
},
}
func init() {
rootCmd.AddCommand(checkCmd)
}