From a40440f8df1da535e1a910d8030f8e1d7f7b7cfb Mon Sep 17 00:00:00 2001 From: Jianyun Date: Sun, 4 Aug 2024 00:07:22 +0800 Subject: [PATCH] api fix --- internal/calibre/api.go | 2 +- internal/calibre/types.go | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/internal/calibre/api.go b/internal/calibre/api.go index f22f68d..3f202b4 100644 --- a/internal/calibre/api.go +++ b/internal/calibre/api.go @@ -83,7 +83,7 @@ func NewClient(config *Config) Api { if err != nil { log.Fatal(err) } - newClient, err := content.NewClient(config.ContentServer) + newClient, err := content.NewClient(config.Content.Server) if err != nil { log.Fatal(err) } diff --git a/internal/calibre/types.go b/internal/calibre/types.go index ffadc1c..bf5a3a5 100644 --- a/internal/calibre/types.go +++ b/internal/calibre/types.go @@ -44,14 +44,19 @@ type BookRaw struct { } type Config struct { - Address string `mapstructure:"address"` - Debug bool `mapstructure:"debug"` - StaticDir string `mapstructure:"static_dir"` - TemplateDir string `mapstructure:"template_dir"` - ContentServer string `mapstructure:"content_server"` - Search Search `mapstructure:"search"` - Storage Storage `mapstructure:"storage"` + Address string `mapstructure:"address"` + Debug bool `mapstructure:"debug"` + StaticDir string `mapstructure:"static_dir"` + TemplateDir string `mapstructure:"template_dir"` + Content Content `mapstructure:"content"` + Search Search `mapstructure:"search"` + Storage Storage `mapstructure:"storage"` } + +type Content struct { + Server string `mapstructure:"server"` +} + type Search struct { Host string `mapstructure:"host"` APIKey string `mapstructure:"apikey"`