refactor api methods
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s

This commit is contained in:
2026-10-08 22:18:53 +02:00
parent ffa4786113
commit 85295deb22
7 changed files with 52 additions and 89 deletions
+8 -1
View File
@@ -2,6 +2,8 @@ package cmd
import (
"fmt"
"kontor-api-gin/internal/api"
"kontor-api-gin/internal/config"
"kontor-api-gin/internal/helpers"
"kontor-api-gin/internal/models"
"log/slog"
@@ -11,6 +13,10 @@ import (
"resty.dev/v3"
)
var (
servername string
)
var addLinksCmd = &cobra.Command{
Use: "add-links [file]",
Short: "Add Links",
@@ -26,7 +32,8 @@ var addLinksCmd = &cobra.Command{
os.Exit(1)
}
client := resty.New()
token := helpers.GetToken(client)
localServer := config.Config.Server[servername]
token := api.GetToken(client, localServer)
for _, line := range lines {
lofiAdd := models.MediaLofiAdd{Url: line}
response, err := client.R().